We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I found some undesired behaviour while using the C++ vector class. A specific inclusion of a bint variable causes other ints to become bints.
bint
int
This code
%%cython -a --cplus from libcpp.vector cimport vector print(<vector[int]>range(10))
outputs [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] which is expected.
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
But this code
%%cython -a --cplus from libcpp.vector cimport vector cdef vector[bint] foobar = [] print(<vector[int]>range(10))
outputs [0, 1, 1, 1, 1, 1, 1, 1, 1, 1] which is very unexpected
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1]
I think something is wrong here.
from libcpp.vector cimport vector cdef vector[bint] foobar = [] print(<vector[int]>range(10))
<vector[int]>range(10) should be a vector with elements [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], but it produces a vector of bint instead.
<vector[int]>range(10)
Windows
3.11
0.29
No response
The text was updated successfully, but these errors were encountered:
Fix conversion of C++ bint containers
d575102
The previously clashed with "int" containers. Fixes cython#5516
Fix Python conversion of C++ bint containers (GH-5518)
52cba82
The previously clashed with "int" containers. Fixes #5516
Successfully merging a pull request may close this issue.
Describe the bug
I found some undesired behaviour while using the C++ vector class. A specific inclusion of a
bint
variable causes otherint
s to becomebint
s.This code
outputs
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
which is expected.
But this code
outputs
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1]
which is very unexpected
I think something is wrong here.
Code to reproduce the behaviour:
Expected behaviour
<vector[int]>range(10)
should be a vector with elements[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
, but it produces a vector ofbint
instead.OS
Windows
Python version
3.11
Cython version
0.29
Additional context
No response
The text was updated successfully, but these errors were encountered: