Message247160
This is an intentional design choice. One reason for tightly coupling OrderedDict to dict was to preserve freedom for a C-implementation. Another reason was for performance. IIRC, using super() in __setitem__ slowed the OD from 10x slower than dicts to 20x.
Non-cooperative classes (of which Python has many) can be wrapped to make the classes cooperative. The technique is discussed in the blog post https://rhettinger.wordpress.com/2011/05/26/super-considered-super/ . |
|
Date |
User |
Action |
Args |
2015-07-23 01:32:59 | rhettinger | set | recipients:
+ rhettinger, eric.snow, eric.frederich |
2015-07-23 01:32:59 | rhettinger | set | messageid: <1437615179.62.0.343828554575.issue24685@psf.upfronthosting.co.za> |
2015-07-23 01:32:59 | rhettinger | link | issue24685 messages |
2015-07-23 01:32:59 | rhettinger | create | |
|