Message303340
I would be happy to write a PR that implements that.
However, i am not sure which way is better to construct a list from the return
value (an iterable, hopefully) of keys() etc.:
- Call PyList_Type() (in each of PyMapping_Keys() etc.) on the iterable, and
overwrite the error message in case it is a TypeError.
- Write a helper function iterable_as_list(), which uses PyObject_GetIter() and
PySequence_List(), and call it in each of PyMapping_Keys() etc..
(iterable_as_list() would receive "keys" etc., so that it would raise the
appropriate error message, in case of a TypeError.)
ISTM that the first one is simpler, but I am not sure about the performance
difference between them. |
|
Date |
User |
Action |
Args |
2017-09-29 16:52:28 | Oren Milman | set | recipients:
+ Oren Milman, rhettinger, serhiy.storchaka, xiang.zhang |
2017-09-29 16:52:28 | Oren Milman | set | messageid: <1506703948.7.0.213398074469.issue28280@psf.upfronthosting.co.za> |
2017-09-29 16:52:28 | Oren Milman | link | issue28280 messages |
2017-09-29 16:52:28 | Oren Milman | create | |
|