Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Tobu
on May 10, 2013
|
parent
|
context
|
favorite
| on:
PEP 435 Accepted – Adding an Enum type to the Pyth...
Since Enums are mostly unmagical (apart from the member wrapping), you can use a compact syntax:
class Colors(Enum): red, green, blue = range(3)
iso8859-1
on May 10, 2013
[–]
will
red, green, blue = itertools.count()
work too?
Tobu
on May 10, 2013
|
parent
[–]
If it works in a Python shell, it will work for an enum (this doesn't).
Join us for
AI Startup School
this June 16-17 in San Francisco!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: