R. David Murray wrote:

If 'a' is now an instance of MyEnum, then I would expect that:

    MyEnum.a.b

would be valid

That is indeed a quirk, but it's not unprecedented. Exactly
the same thing happens in Java. This compiles and runs:

  enum Foo {
    a, b
  }

  public class Main {

    public static void main(String[] args) {
      System.out.printf("%s\n", Foo.a.b);
    }

  }

There probably isn't much use for that behaviour, but on
the other hand, it's probably not worth going out of our
way to prevent it.

--
Greg
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to