Message275743
| Author |
veky |
| Recipients |
barry, eli.bendersky, ethan.furman, ezio.melotti, python-dev, r.david.murray, rhettinger, serhiy.storchaka, veky |
| Date |
2016年09月11日.08:10:50 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1473581451.1.0.867666638191.issue23591@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> Which means it has methods such as __getitem__, __setitem__, etc., which means those methods can implement whatever is needed to give the namespace the desired semantics (within Python syntax).
Ah, _that_'s what you had in mind. (All this time, I thought _auto_ was just a shorter name for _generate_next_value_.:) I'm ok with that. But aren't we then back to square one? (Using magic of the same kind as the "declarative style" that Raymond pronounced not Pythonic enough.)
Even Raymond says
> As long as _auto_ has been defined somewhere (i.e. from enum import _auto_), it is normal Python
I'm sure he didn't think of the loophole you're currently exploiting. :-D
But anyway, I'm happy. Parentheses are there, so the intuition of calling a function to execute code is respected, and if you get out free with this hack, it opens a door a bit wider for complete declarative solution in the future. |
|