[issue10220] Make generator state easier to introspect

Nick Coghlan report at bugs.python.org
Sun Nov 21 04:04:02 CET 2010


Nick Coghlan <ncoghlan at gmail.com> added the comment:

I'll actually go with version 1 of the patch as far as the variable initialisation goes. Yes, it is fractionally slower, but you get a maintenance gain from the fact that the enum values are guaranteed to be orthogonal, and this is clearly obvious to the reader.

When you write the assignments out explicitly, the reader has to actually look at the assigned values to determine whether or not the same value is ever assigned twice.

(No need to post a modified patch - I'll fix it before I check it in)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10220>
_______________________________________


More information about the Python-bugs-list mailing list