B
Bruno Desthuilliers
Sergey Simonenko a écrit :
I indeed notice this behaviour here (Python 2.6.2). I'm afraid it has to
do with some optimization tricks (dict being the very fundamental data
structure in Python, it has to be higly optimized).
Hi,
I subclass builtin 'dict' in my application and experience some problems
with it.
The whole issue is that I should redefine 'setdefault' and 'update'
methods after redefining '__setitem__' or/and '__delitem__',
otherwise 'update' and 'setdefault' ignore redefined '__setitem__' and
use builtin dict's one so dict looks kinda like a black box.
Another guy have reported me that he experiences similar problems with
subclassing builtin 'list'.
I indeed notice this behaviour here (Python 2.6.2). I'm afraid it has to
do with some optimization tricks (dict being the very fundamental data
structure in Python, it has to be higly optimized).