A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-May/125925.html below:

[Python-Dev] PyPy, Jython, & IronPython: Enum convenience function and pickleablity

[Python-Dev] PyPy, Jython, & IronPython: Enum convenience function and pickleablitySteven D'Aprano steve at pearwood.info
Fri May 3 11:40:21 CEST 2013
On 03/05/13 18:42, Antoine Pitrou wrote:
> Le Fri, 3 May 2013 09:14:22 +1000,
> Nick Coghlan <ncoghlan at gmail.com> a écrit :

>> I would suggest moving the field names into the class header for a
>> class based convenience API:
>>
>> class Animal(Enum, members='cat dog'): pass
>
> This looks good to me (assuming some people don't like the
> special attribute scheme).

The problem is that this is not an expression, it is a statement. The advantage of the convenience function is not just that it is shorter, but that it is an expression.



-- 
Steven
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4