Dynamically Defined Functions in Classes?
Pieter Nagel
pieter at nagel.co.za
Wed Jan 31 21:45:00 EST 2001
More information about the Python-list mailing list
Wed Jan 31 21:45:00 EST 2001
- Previous message (by thread): Dynamically Defined Functions in Classes?
- Next message (by thread): Perl-to-Python converter/translator?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, 31 Jan 2001, Jim Meyer wrote:
> I have an application in which I wish to treat the members of a
> dictionary as attributes;
class Bar:
def __init__(self, initial_dict):
self.__dict__ = initial_dict
b = Bar({'joe' : 'cool', 'frank' : 'lee', 'ron' : 'dell'})
print b.joe
b.frank = 'foo'
--
,_
/_) /| /
/ i e t e r / |/ a g e l
- Previous message (by thread): Dynamically Defined Functions in Classes?
- Next message (by thread): Perl-to-Python converter/translator?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list