class derived from dict in eval

Jp Calderone exarkun at
Mon Feb 24 22:38:41 CET 2003

On Mon, Feb 24, 2003 at 02:47:32PM +0100, Florian Schulze wrote:
> Hi!
> I want to use my own class which is derived from dict as locals in the eval 
> function, but I can't get it to work. My class calculates values dependant 
> on the key. Is this possible at all, or am I at a dead end here? If it's 
> possible, then please tell me which methods I have to implement.

  This won't work, Python bypasses the mapping protocol and access dict
items directly.


"One World, one Web, one Program." - Microsoft(R) promotional ad
"Ein Volk, ein Reich, ein Fuhrer." - Adolf Hitler
 up 16 days, 2:29, 5 users, load average: 0.00, 0.03, 0.05
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <>

More information about the Python-list mailing list