Guido van Rossum wrote:
On Saturday, April 27, 2013, Greg Ewing wrote:

      class Planet(Enum):
        MERCURY = (3.303e+23, 2.4397e6)
        VENUS   = (4.869e+24, 6.0518e6)
        EARTH   = (5.976e+24, 6.37814e6)

        def __init__(self, mass, radius):
          self.mass = mass
          self.radius = radius

If you want something like this, doyou really have to inherit from Enum?

I suppose not, but the same could be said for cases where
you want to add methods to enums, etc.

--
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