How can a function find the function that called it?

DevPlayer devplayer at gmail.com
Sat Dec 25 17:41:16 EST 2010


> Original Poster
> I thought I'd implement it as a subclass of collections.OrderedDict
> that prohibits all modifications to the dictionary after it has
> been initialized.

I thought the __new__() method was for customizing how objects where
instantated. Where in __new__() you would get an object instance and
then usually initialize the public data attributes in __init__().
Although I like Mark Wooding's solution as it's clean and easy to
understand.



More information about the Python-list mailing list