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/126051.html below:

[Python-Dev] PEP 435: initial values must be specified? Yes

[Python-Dev] PEP 435: initial values must be specified? Yes [Python-Dev] PEP 435: initial values must be specified? YesEthan Furman ethan at stoneleaf.us
Mon May 6 19:53:57 CEST 2013
On 05/06/2013 10:48 AM, Georg Brandl wrote:
> Am 05.05.2013 22:09, schrieb Ethan Furman:
>
>> About the closest you going to be able to get is something like:
>>
>> def e(_next=[1]):
>>       e, _next[0] = _next[0], _next[0] + 1
>>       return e
>>
>> class Color(Enum):
>>       red = e()
>>       green = e()
>>       blue = e()
>
> Uh, that's surely more nicely spelled as "e = itertools.count()"?

Why, yes, I believe it is.  :)

--
~Ethan~
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