Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Adding support for set and frozenset objects #437

Answered by pyscripter
oleg-oleinik asked this question in Q&A
Discussion options

Hello,
Do you plan to connect python objects of type set and frozenset to p4d?
How can a Delphi program now iterate over such objects or check for the presence of specific values?
Thank you.

You must be logged in to vote

You can manipulate them using the sequence api.
For instance using VarPyth:

PySet := VarPythonEval('set("abc")');
for var member in VarPyIterate(PySet) do
  WriteLn(member);
if PySet.Contains("a") then
  Writeln('PySet contains "a");

Replies: 2 comments · 1 reply

Comment options

You can manipulate them using the sequence api.
For instance using VarPyth:

PySet := VarPythonEval('set("abc")');
for var member in VarPyIterate(PySet) do
  WriteLn(member);
if PySet.Contains("a") then
  Writeln('PySet contains "a");
You must be logged in to vote
1 reply
@oleg-oleinik
Comment options

Thanks for the detailed answer.

Answer selected by oleg-oleinik
Comment options

I have turned this into an issue #438 so that the python set C-API will be added.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.