On Tue, 20 Sep 2005 13:59:50 -0700, Robert Kern wrote:
> globals needs to be a real dictionary. The implementation uses the C
> API, it doesn't use the overridden __getitem__. The locals argument,
> apparently can be some other kind of mapping.
It seems that on Python 2.3 then neither globals or
Jeremy Sanders wrote:
> Hi -
>
> I'm trying to subclass a dict which is used as the globals environment of
> an eval expression. For instance:
>
> class Foo(dict):
> def __init__(self):
> self.update(globals())
> self['val'] = 42
>
> def __getitem__(self,
Jeremy Sanders wrote:
> Hi -
>
> I'm trying to subclass a dict which is used as the globals environment of
> an eval expression. For instance:
>
> class Foo(dict):
> def __init__(self):
> self.update(globals())
> self['val'] = 42
>
> def __getitem__(self,
Hi -
I'm trying to subclass a dict which is used as the globals environment of
an eval expression. For instance:
class Foo(dict):
def __init__(self):
self.update(globals())
self['val'] = 42
def __getitem__(self, item):
# this doesn't get called fr