This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients
Date 2006-02-21.13:27:03
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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.
History
Date User Action Args
2007-08-23 15:45:48adminlinkissue1433928 messages
2007-08-23 15:45:48admincreate