> 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
kj writes:
> But OrderedDict's functionality *requires* that its __init__ be
> run, and this __init__, in turn, does part of its initialization
> by calling the update method.
>
> Therefore, the update method of the new subclass needs to be able
> to identify the calling function in order to make
In Daniel Urban
writes:
>On Fri, Dec 24, 2010 at 17:24, kj wrote:
>> (BTW, I don't understand why inspect doesn't provide something as
>> basic as the *class* that the method belongs to, whenever applicable.
>> I imagine there's a good reason for this coyness, but I can't figure
>> it out.)
>
On 12/24/2010 8:51 AM, Chris Gonnerman wrote:
On 12/24/2010 10:24 AM, kj wrote:
I want to implement a frozen and ordered dict.
I thought I'd implement it as a subclass of collections.OrderedDict
that prohibits all modifications to the dictionary after it has
been initialized.
That's actua
On Fri, Dec 24, 2010 at 17:24, kj wrote:
> (BTW, I don't understand why inspect doesn't provide something as
> basic as the *class* that the method belongs to, whenever applicable.
> I imagine there's a good reason for this coyness, but I can't figure
> it out.)
One function object can "belong to
On Dec 24, 8:24 am, kj wrote:
> I want to implement a frozen and ordered dict.
>
> I thought I'd implement it as a subclass of collections.OrderedDict
> that prohibits all modifications to the dictionary after it has
> been initialized.
>
> In particular, calling this frozen subclass's update meth
On 12/24/2010 10:24 AM, kj wrote:
I want to implement a frozen and ordered dict.
I thought I'd implement it as a subclass of collections.OrderedDict
that prohibits all modifications to the dictionary after it has
been initialized.
In particular, calling this frozen subclass's update method shou
I want to implement a frozen and ordered dict.
I thought I'd implement it as a subclass of collections.OrderedDict
that prohibits all modifications to the dictionary after it has
been initialized.
In particular, calling this frozen subclass's update method should,
in general, trigger an exce