Message49513
Logged In: YES
user_id=80475
Neal, the defdict_on_missing check for Py_None is
necessary because the user can assign None to the factory
and expect it to have the same effect as NULL. The other
checks for NULL all automatically handle the Py_None case
the same as if the attribute were filled with a real
factory.
Code nits:
----------
Pre-parse:
PyEval_CallMethod((PyObject *)mp, "on_missing", "(O)",
key);
into:
PyObject_CallMethodObjArgs((PyObject *)mp, "on_missing",
key, NULL);
The first four lines in defdict_dealloc() can be
simplified to:
Py_Clear(dd->default_factory);
Likewise, the first five active lines of defdict_traverse
shrink to:
Py_VISIT(dd->default_factory);
The OFF() macro is used only once. Better to in-line it.
Other
-----
If you don't get a chance to add the docs, just apply the
patch and I'll write the docs later.
Likewise, I'll update UserDict and DictMixin to keep the
APIs in-sync.
|
|
Date |
User |
Action |
Args |
2007-08-23 15:45:48 | admin | link | issue1433928 messages |
2007-08-23 15:45:48 | admin | create | |
|