Message51526
As I understand it, the problem is that dict.update is assuming any dict subclass will use the same internal data representation.
Restricting the fast path to exactly builtin dicts (not subclasses) fixes the bug, but makes the fallback more frequent.
The existing fallback is to call keys(), then iterate over it, retrieving the value for each key. (keys is required for a "minimal mapping" as documented is UserDict, and a few other random places.)
The only potential dependency on other methods is his proposed new intermediate path that avoids creating a list of all keys, by using iterkeys if it exists. (I suggested using iteritems to avoid the lookups.) If iter* aren't implemented, the only harm is falling back to the existing fallback of "for k in keys():"
|
|
Date |
User |
Action |
Args |
2007-08-23 15:55:43 | admin | link | issue1615701 messages |
2007-08-23 15:55:43 | admin | create | |
|