On 1/18/2011 9:34 AM, Karim wrote:

Hello Bob,

Thanks for this better and simple approach!
To be perfect I would like to be able to do.
>>> type = CategoryType()
>>> type.TRANSISTOR

Add to the class:

    def __getattr__(self, name):
        return self.enums[name]

Note this does not handle the upper/lower case issue.

--
Bob Gailer
919-636-4239
Chapel Hill NC

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to