Re: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library

2013-04-13 Thread Guido van Rossum
So clearly the ree expectation is that they compare equal (if the values are). On Apr 13, 2013 11:24 AM, "Scott Dial" wrote: > On 4/12/2013 10:51 PM, Steven D'Aprano wrote: > > And two examples from asm-generic/errno.h: > > > > #define EWOULDBLOCK EAGAIN /* Operation would block */ > > #defi

Re: [Python-Dev] [Announcement] New mailing list for code quality tools including Flake8, Pyflakes and Pep8

2013-04-13 Thread Ben Finney
Ian Cordasco writes: > Are you concerned about the evolution of various code checkers? > Do you have questions or suggestions? > > Subscribe here: > http://mail.python.org/mailman/listinfo/code-quality Now available via Gmane also http://dir.gmane.org/gmane.comp.python.code-quality>. Thanks guy

Re: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library

2013-04-13 Thread Scott Dial
On 4/12/2013 10:51 PM, Steven D'Aprano wrote: > And two examples from asm-generic/errno.h: > > #define EWOULDBLOCK EAGAIN /* Operation would block */ > #define EDEADLOCK EDEADLK > That's actually even better of an example than you may have realized because historically EWOULDBLOCK !=

Re: [Python-Dev] Deciding against the CLA (was: Introducing Electronic Contributor Agreements)

2013-04-13 Thread Brett Cannon
On Sat, Apr 13, 2013 at 6:30 AM, Ben Finney wrote: > "Stephen J. Turnbull" writes: > >> Mark Lawrence writes: >> >> > People already use the bug tracker as an excuse not to contribute, >> > wouldn't this requirement make the situation worse? >> >> A failure to sign the CLA is already a decision

Re: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library

2013-04-13 Thread Guido van Rossum
[Eli] >> It is applicable, in the sense that os.O_CREAT etc can be IntEnum values. >> Their bitset operation results will be simple integers. It's not planned to >> add a special enum for this - this was ruled against during the Pycon >> discussions. On Sat, Apr 13, 2013 at 7:30 AM, Serhiy Storcha

Re: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library

2013-04-13 Thread Serhiy Storchaka
On 13.04.13 03:13, Glenn Linderman wrote: On 4/12/2013 3:59 PM, Guido van Rossum wrote: class Insect(Enum): wasp = 1 bee = 1 ant = 2 We'd have Insect.wasp == Insect.bee < Insect.ant but Insect.wasp is not Insect.bee. can't define two names in the same enum to have the same valu

Re: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library

2013-04-13 Thread Serhiy Storchaka
On 13.04.13 15:43, Eli Bendersky wrote: On Sat, Apr 13, 2013 at 1:31 AM, Serhiy Storchaka wrote: On 12.04.13 15:55, Eli Bendersky wrote: There is some ambiguity in the term "enumeration values". On the one hand, it's the singleton instances of the enumeration class (Colors.red, Colors.gree, C

Re: [Python-Dev] [Python-checkins] cpython (2.7): Issue #16447: Fix potential segfault when setting __name__ on a class.

2013-04-13 Thread Eli Bendersky
On Sat, Apr 13, 2013 at 7:25 AM, Eli Bendersky wrote: > Test case? > > Ugh, sorry. I missed it. Ignore my previous email please. Eli > > On Sat, Apr 13, 2013 at 7:19 AM, mark.dickinson < > python-check...@python.org> wrote: > >> http://hg.python.org/cpython/rev/d5e5017309b1 >> changeset: 83

Re: [Python-Dev] [Python-checkins] cpython (2.7): Issue #16447: Fix potential segfault when setting __name__ on a class.

2013-04-13 Thread Eli Bendersky
Test case? On Sat, Apr 13, 2013 at 7:19 AM, mark.dickinson wrote: > http://hg.python.org/cpython/rev/d5e5017309b1 > changeset: 83283:d5e5017309b1 > branch: 2.7 > user:Mark Dickinson > date:Sat Apr 13 15:19:05 2013 +0100 > summary: > Issue #16447: Fix potential segfault

Re: [Python-Dev] [Python-checkins] cpython (2.7): Issue #16447: Fix potential segfault when setting __name__ on a class.

2013-04-13 Thread Benjamin Peterson
2013/4/13 Eli Bendersky : > Test case? I see one. > > > On Sat, Apr 13, 2013 at 7:19 AM, mark.dickinson > wrote: >> >> http://hg.python.org/cpython/rev/d5e5017309b1 >> changeset: 83283:d5e5017309b1 >> branch: 2.7 >> user:Mark Dickinson >> date:Sat Apr 13 15:19:05 2013 +01

Re: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library

2013-04-13 Thread Eli Bendersky
On Sat, Apr 13, 2013 at 6:43 AM, Lennart Regebro wrote: > OK, so I finally got tie to read the PEP. I like it, I really have > missed Enums, this is awesome. > > That's all folks! > > //Lennart > More of these kinds of comments ;-) Thanks, Lennart. __

Re: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library

2013-04-13 Thread Lennart Regebro
OK, so I finally got tie to read the PEP. I like it, I really have missed Enums, this is awesome. That's all folks! //Lennart ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.

Re: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library

2013-04-13 Thread Eli Bendersky
On Sat, Apr 13, 2013 at 1:31 AM, Serhiy Storchaka wrote: > On 12.04.13 15:55, Eli Bendersky wrote: > >> The enumeration value names are available through the class members:: >> >> >>> for member in Colors.__members__: >> ... print(member) >> red >> green >> blue >> > >

[Python-Dev] Deciding against the CLA (was: Introducing Electronic Contributor Agreements)

2013-04-13 Thread Ben Finney
"Stephen J. Turnbull" writes: > Mark Lawrence writes: > > > People already use the bug tracker as an excuse not to contribute, > > wouldn't this requirement make the situation worse? > > A failure to sign the CLA is already a decision not to contribute to > the distribution As someone who can

Re: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library

2013-04-13 Thread Serhiy Storchaka
On 12.04.13 15:55, Eli Bendersky wrote: The enumeration value names are available through the class members:: >>> for member in Colors.__members__: ... print(member) red green blue This is unnecessary because enumerations are iterable. Colors.__members__ is equal