On Mon, May 13, 2013 at 8:49 AM, Jim Jewett <jimjjewett@gmail.com> wrote:
The problem with
Animals = Enum('Animals', 'dog cat bird')
is that you might accidentally type
Animals = Enum('Animal', 'dog cat bird') or Anmals = Enum('Animals', 'dog cat bird')
instead.
Sure. But coming up with a syntactic solution for this issue is not easy. So far all the proposals from this thread (and from past threads trying to address the same issues, including PEP 403) look terrible to me -- none of the proposals are more than random permutations of symbols that are currently syntactically invalid are given a fairly random new meaning. So in the mean time please live with the slight redundancy in this case. Next time you may want to try and design syntax so that you won't have to type the same method name twice when you're defining a function and later calling it. :-) -- --Guido van Rossum (python.org/~guido)