Message234442
| Author |
mark |
| Recipients |
docs@python, mark |
| Date |
2015年01月21日.20:00:29 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1421870429.3.0.139624304143.issue23292@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I think it would be worth documenting
globals().update(MyEnumeration.__members__) in the "Interesting
Examples" section of the enum docs.
I suspect that most people will find that importing enums is annoying
because they'll get
import A
print(A.MyEnumeration.MAX)
when they're more used to
import A
print(A.MAX)
Of course the latter is easily achieved using the globals().update()
trick (as used in signals.py in 3.5).
Georg suggested I add this to the tracker. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2015年01月21日 20:00:29 | mark | set | recipients:
+ mark, docs@python |
| 2015年01月21日 20:00:29 | mark | set | messageid: <1421870429.3.0.139624304143.issue23292@psf.upfronthosting.co.za> |
| 2015年01月21日 20:00:29 | mark | link | issue23292 messages |
| 2015年01月21日 20:00:29 | mark | create |
|