use PySequence* instead of PyList* as return to the objects#38
use PySequence* instead of PyList* as return to the objects#38PierreSchnizer wants to merge 2 commits intoklemenv:mainfrom
Conversation
|
Built-in Python sequence types are list, tuple, string, bytes, and maybe a few others. Changing from PyList to PySequence seem to be more generic and allow other return types, my only concern is breaking the compatibility or anything else in the code. Have you thoroughly tested with various types? If I was to merge this, I would ask you to remove motivating_sequence.md from the commit. What is the reason for defining Py_LIMITED_API? |
|
Good point for all the different tests, I will try to add them to the test cases. Furthermore I remove the motivating sequence.md Concerning limited api: I added it so that I would see if I used some "too fancy feature" in my addition. I suggest to remove it. Just for completeness a link to the description of the limited-c-api |
Motivation
pycalcRecord and the waveform record of pydev accept lists of data as return from python.
The limit to lists can be lifted if one uses the PySquence* functions to handle the
object that python returns. Therefore at least the following object types can be returned
An example usage is illustrated in the file motivating sequence.