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 belopolsky
Recipients
Date 2007-04-26.04:14:04
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
If you remove partial_type.tp_dict = PyDict_New(); at line 309, the patch will pass test_functools.

A few comments:

Design:
1. partial.skip should be an instance of a singleton class (look at NoneType implementation in object.c)
2. repr(partial.skip) should be 'functools.partial.skip' (easy to implement once #1 is done)

Implementation:
1.  In the loop over pto->args you know that i < npargs, so you can use PyTuple_GET_ITEM and there is no need to check for arg==NULL
2. You should check PyTuple_GetItem(args, pull_index) for null and return with error if too few arguments is supplied.  Better yet, find number of supplied args outside the loop and raise your own error if pool_index grows to that number.
3. It looks like you are leaking references. I don't see where you decref ptoargscopy and arg after concatenation.
History
Date User Action Args
2007-08-23 16:12:46adminlinkissue1706256 messages
2007-08-23 16:12:46admincreate