You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to be able to use the set() function. This is important so that empty sets can be created. The set() function is different to the {,} function as it takes an iterable.
Test Code
Provide code which does not currently work but which should do when this issue is fixed:
This feature should be implemented similarly to what was done for tuples. The equivalent issues for tuples was resolved in #1589.
The pertinent code is:
raiseTypeError(f"Can't unpack {arg} into a tuple")
Additional context
It is important to handle the set function so that this function can be used for type annotations. If the {,} function is used bugs such as #1892 can arise.
The text was updated successfully, but these errors were encountered:
Add support for the `set()` function in Python. This fixes#1893.
In this PR, the `PythonSetFunction` class is introduced to handle calls
to the `set()` function, along with the addition of related tests.
Describe the feature
I would like to be able to use the
set()
function. This is important so that empty sets can be created. Theset()
function is different to the{,}
function as it takes an iterable.Test Code
Provide code which does not currently work but which should do when this issue is fixed:
Proposed Solution
This feature should be implemented similarly to what was done for tuples. The equivalent issues for tuples was resolved in #1589.
The pertinent code is:
pyccel/pyccel/ast/builtins.py
Lines 596 to 620 in d64be7f
Additional context
It is important to handle the
set
function so that this function can be used for type annotations. If the{,}
function is used bugs such as #1892 can arise.The text was updated successfully, but these errors were encountered: