[Tutor] What is __weakref__ ?

bob gailer bgailer at gmail.com
Tue Jan 18 15:38:52 CET 2011


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110118/40a2e4c3/attachment.html>


More information about the Tutor mailing list