Message55087
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.
|
|
Date |
User |
Action |
Args |
2007-08-23 16:12:46 | admin | link | issue1706256 messages |
2007-08-23 16:12:46 | admin | create | |
|