On 4/28/2013 9:09 PM, Guido van Rossum wrote:
(2a. We could also allow Color('red') is Color.red, but that could be
confusing, and we can already do that with getattr(Color, 'red'), and
bool('False') doesn't return False anyway, so let's not do that.)
Glad you made this pronouncement in this way, because otherwise there
would be ambiguity in the case:
class Color(Enum):
red = 'white'
white = 'blue'
blue = 'red'
although that would no doubt drive the programmers batty anyway... but there
may be instances where code is generated that could produce something
ambiguous, even though this example is atrocious.
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com