Skip to content

Conversation

@PierreSchnizer
Copy link

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

  • tuples
  • lists
  • arrays.

An example usage is illustrated in the file motivating sequence.

@klemenv
Copy link
Owner

klemenv commented Feb 16, 2025

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?

@PierreSchnizer
Copy link
Author

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
https://docs.python.org/3/c-api/stable.html#limited-c-api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants