On Sun, Aug 19, 2018 at 9:03 AM, Marko Rauhamaa wrote:
> Chris Angelico :
>
>> *headscratch*
>>
>> So this is okay:
>>
>> def f():
>> for i in range(5):
>> def g(): ...
>>
>> But this isn't:
>>
>> class C:
>> for i in range(5):
>> def m(self): ...
>>
>> I've missed somethin
On Sun, Aug 19, 2018 at 2:47 PM, Sharan Basappa
wrote:
> I am not sure what the issue is with the 2nd file that assigns string to text
> variable.
>
> Here is the code:
> # -*- coding: utf-8 -*-
> text = “this’s a sent tokenize test. this is sent two. is this sent three?
> sent 4 is cool! Now it
Chris Angelico :
> *headscratch*
>
> So this is okay:
>
> def f():
> for i in range(5):
> def g(): ...
>
> But this isn't:
>
> class C:
> for i in range(5):
> def m(self): ...
>
> I've missed something here.
No, you got it right.
Marko
--
https://mail.python.org/mailman
https://imgur.com/gallery/tW1lwEl
--
https://mail.python.org/mailman/listinfo/python-list
I am not sure what the issue is with the 2nd file that assigns string to text
variable.
Here is the code:
# -*- coding: utf-8 -*-
text = “this’s a sent tokenize test. this is sent two. is this sent three? sent
4 is cool! Now it’s your turn.”
from nltk.tokenize import sent_tokenize
sent_tokenize_
Greetings all,
I currently follow PEP 440 as it relates to my application. Right now we follow
a x.y.z scheme, with y incrementing with our normal releases, z incrementing
for any bug fixes for that release, and x not really incrementing unless
something major happens (for example, our conversi
On Sat, 18 Aug 2018 16:16:54 -0700, giannis.dafnomilis wrote:
> I have the results of an optimization run in the form found in the
> following pic: https://i.stack.imgur.com/pIA7i.jpg.
Unless you edit your code with Photoshop, why do you think a JPEG is a
good idea?
That discriminates against t
On Sun, Aug 19, 2018 at 11:13 AM, Steven D'Aprano
wrote:
> Obviously there is some (small) complexity cost to automating it. I
> didn't specify what a fair number of methods would be (my example showed
> four, but that was just an illustration, not real code). In practice I
> wouldn't even conside
On Sun, 19 Aug 2018 00:11:30 +0300, Marko Rauhamaa wrote:
> In Python programming, I mostly run into closures through inner classes
> (as in Java).
Inner classes aren't closures.
Its also quite expensive to be populating your application with lots of
classes used only once each, which is a comm
On 2018-08-19 00:16, giannis.dafnomi...@gmail.com wrote:
I have the results of an optimization run in the form found in the following
pic: https://i.stack.imgur.com/pIA7i.jpg.
How can I multiply the dictionary values of the keys FEq_(i,_j,_k,_l) with
preexisting values of the form A[i,j,k,l]?
I have the results of an optimization run in the form found in the following
pic: https://i.stack.imgur.com/pIA7i.jpg.
How can I multiply the dictionary values of the keys FEq_(i,_j,_k,_l) with
preexisting values of the form A[i,j,k,l]?
For example I want the value of key 'FEq_(0,_0,_2,_2)' mul
On Sun, Aug 19, 2018 at 7:11 AM, Marko Rauhamaa wrote:
> Chris Angelico :
>> Your acceptance of closures is a perfect proof of how magic stops
>> looking like magic once you get accustomed to it.
>
> Actually, that's a very good observation. You should stick with a
> smallish kernel of primitives
Chris Angelico :
> Your acceptance of closures is a perfect proof of how magic stops
> looking like magic once you get accustomed to it.
Actually, that's a very good observation. You should stick with a
smallish kernel of primitives and derive the universe from them.
Anyway, functions as first-cl
On Sun, Aug 19, 2018 at 6:28 AM, Marko Rauhamaa wrote:
> Steven D'Aprano :
>>> In a word, steer clear of metaprogramming.
>>
>> [...]
>> (2) if you mean what you say, that means no decorators,
>
> Correct. I don't find decorators all that useful or tasteful.
>
>> no closures,
>
> Closures I consid
Steven D'Aprano :
>> In a word, steer clear of metaprogramming.
>
> [...]
> (2) if you mean what you say, that means no decorators,
Correct. I don't find decorators all that useful or tasteful.
> no closures,
Closures I consider ordinary programming. Nothing meta there.
> no introspection ("ref
On Sat, 18 Aug 2018 00:33:26 +0300, Marko Rauhamaa wrote:
> Chris Angelico :
>> Programming is heavily about avoiding duplicated work.
>
> That is one aspect, but overcondensing and overabstracting programming
> logic usually makes code less obvious to its maintainer.
That may very well be true
On 2018-08-18 16:43, Jason Friedman wrote:
$ python3
Python 3.6.1 (default, Apr 8 2017, 09:56:20)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
import collections, datetime
x = collections.defaultdict(int)
x['something']
0
x = collections
$ python3
Python 3.6.1 (default, Apr 8 2017, 09:56:20)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import collections, datetime
>>> x = collections.defaultdict(int)
>>> x['something']
0
>>> x = collections.defaultdict(datetime.datetime)
18 matches
Mail list logo