[issue37708] Harmonize random.choice(s) behavior with random.sample on iterators

2019-07-29 Thread Lex Flagel
New submission from Lex Flagel : It would be nice to make random.sample and random.choice both have the same behavior with iterators. Currently random.sample accepts them happily, and whereas random.choice does not. E.g. > import random > d = {'a':1, 'b':2} > random.sample(d.keys

[issue14092] __name__ inconsistently applied in class definition

2012-02-22 Thread Lex Berezhny
New submission from Lex Berezhny eukre...@gmail.com: The following behavior doesn't make sense, especially since it works correctly for other special attributes: class F: __name__ = Foo F.__name__ 'F' F().__name__ 'Foo' F.__name__ = 'Foo' F.__name__ 'Foo' Works fine

[issue14092] __name__ inconsistently applied in class definition

2012-02-22 Thread Lex Berezhny
Changes by Lex Berezhny eukre...@gmail.com: -- versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14092 ___ ___ Python-bugs-list

[issue14092] __name__ inconsistently applied in class definition

2012-02-22 Thread Lex Berezhny
Lex Berezhny eukre...@gmail.com added the comment: I think for __class__ it might make sense but for __name__ it seems not intuitive. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14092

[issue14092] __name__ inconsistently applied in class definition

2012-02-22 Thread Lex Berezhny
Lex Berezhny eukre...@gmail.com added the comment: The one in __name__ since logically that happens after the class declaration ('class X' line) and should overwrite the name in the class declaration. -- ___ Python tracker rep...@bugs.python.org

[issue14092] __name__ inconsistently applied in class definition

2012-02-22 Thread Lex Berezhny
Lex Berezhny eukre...@gmail.com added the comment: I don't particularly need this functionality. It was just something that seemed counter intuitive to me. I discovered this while working on a python to javascript compiler. I'll probably implement the compiler to allow overriding

Kohonen neural network

2010-05-26 Thread Lex Lebedeff
Hello! Has anyone tried to build an implementation of subject in Python? Any help is appreciated! --- news://freenews.netfront.net/ - complaints: n...@netfront.net --- -- http://mail.python.org/mailman/listinfo/python-list

Re: Kohonen neural network

2010-05-26 Thread Lex Lebedeff
On Wed, 26 May 2010 05:26:56 -0700, alex23 wrote: On May 26, 7:21 pm, Lex Lebedeff l...@from.hell wrote: Has anyone tried to build an implementation of subject in Python? Any help is appreciated! http://www.dia.fi.upm.es/~jamartin/download.htm Seriously, though, any reason why you

Re: Is there a best linux distro for a python hobbyist?

2009-01-05 Thread Lex Hider
Probably not a big difference in most cases between debian, ubuntu, fedora. The latter two may be more likely to have more recent versions. I'm pretty sure ubuntu is the only one which currently has python 3.0 in it's archives [no, it's not the default version]. On 06/01/2009, member thudfoo

replace c-style comments with newlines (regexp)

2007-12-20 Thread lex __
I'm tryin to use regexp to replace multi-line c-style comments (like /* this /n */ ) with /n (newlines). I tried someting like re.sub('/\*(.*)/\*' , '/n' , file) but it doesn't work for multiple lines. besides that I want to keep all newlines as they were in the original file, so I can

What is the most efficient way to test for False in a list?

2007-07-08 Thread lex
Of course there is the always the iteration method: list = [1, True, True, False, False, True] status = True for each in list: status = status and each but what is your best way to test for for False in a list? -- http://mail.python.org/mailman/listinfo/python-list

Request for tips on my first python script.

2006-09-07 Thread Lex Hider
the overall structure is up the creek. approx 220 LOC. file: GodCast.py Cheers, Lex. #!/usr/bin/python # GodCast: podcast aggregator! # depends on wget lynx # * one of the main features of GodCast is it's use of bandwidth. #Many podcatchers # http://www.faqts.com/knowledge_base/view.phtml/aid