A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/345160.html below:

Wrapping classes

Wrapping classesbruno modulix onurb at xiludom.gro
Fri Sep 23 06:54:53 EDT 2005
Jeremy Sanders wrote:
> Diez B. Roggisch wrote:
> 
> 
>>It works - in python 2.4!! I tried subclassing dict, but my
>>__getitem__-method wasn't called - most probably because it's a C-type,
>>but I don't know for sure. Maybe someone can elaborate on that?
> 
> 
> Yes - I tried that (see thread below). Unfortunately it needs Python 2.4,
> and I can't rely on my users having that.
> 
> Traceback (most recent call last):
>   File "test.py", line 15, in ?
>     print eval("10 * a + b", globals(), l)
> TypeError: eval() argument 3 must be dict, not Foo
> 
> If you subclass dict it doesn't call the __getitem__ method.

Could it work with a UserDict subclass ?


-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4