Re: [Python-Dev] a Constant addition to enum

2013-08-19 Thread Barry Warsaw
On Aug 06, 2013, at 02:36 PM, Eli Bendersky wrote: >Personally, I dislike all non-simple uses of Enums. One such use is adding >behavior to them. This can always be split to separate behavior from the >Enum itself, and I would prefer that. We went to great lengths to ensure >that things work in ex

Re: [Python-Dev] a Constant addition to enum

2013-08-06 Thread Nick Coghlan
On 7 August 2013 07:36, Eli Bendersky wrote: > On Tue, Aug 6, 2013 at 1:42 PM, Ethan Furman wrote: >> >> A question came up on stackoverflow asking about the Planet example and >> the need to have the constant G defined in the method instead of at the >> class level: >> >> http://stackoverflow.co

Re: [Python-Dev] a Constant addition to enum

2013-08-06 Thread Antoine Pitrou
On Tue, 6 Aug 2013 14:36:27 -0700 Eli Bendersky wrote: > On Tue, Aug 6, 2013 at 1:42 PM, Ethan Furman wrote: > > > A question came up on stackoverflow asking about the Planet example and > > the need to have the constant G defined in the method instead of at the > > class level: > > > > http://s

Re: [Python-Dev] a Constant addition to enum

2013-08-06 Thread Eli Bendersky
On Tue, Aug 6, 2013 at 1:42 PM, Ethan Furman wrote: > A question came up on stackoverflow asking about the Planet example and > the need to have the constant G defined in the method instead of at the > class level: > > http://stackoverflow.com/q/**17911188/208880

[Python-Dev] a Constant addition to enum

2013-08-06 Thread Ethan Furman
A question came up on stackoverflow asking about the Planet example and the need to have the constant G defined in the method instead of at the class level: http://stackoverflow.com/q/17911188/208880 Since methods and descriptors are immune to enumeration my proposed solution created a Constant