Skip to content
New issue

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

memoryview with Int64List produces unexpected result #139

Open
wrobell opened this issue Jul 5, 2019 · 1 comment
Open

memoryview with Int64List produces unexpected result #139

wrobell opened this issue Jul 5, 2019 · 1 comment

Comments

@wrobell
Copy link

wrobell commented Jul 5, 2019

Please consider

from pyrobuf_list import Int64List

data = Int64List()
data.extend(range(10))
print(list(memoryview(data)))

On my machine above prints

[0, 72057594037927936, 281474976710656, 1099511627776, 4294967296, 16777216, 65536, 256, 1, 144115188075855872]

Python 3.7 (https://docs.python.org/3/library/array.html), the signed 64-bit int shall be represented by 'q' format, not 'L'. This was introduced in Python 3.3.

@wrobell wrobell changed the title memoryview with Int64List produces garbage memoryview with Int64List produces unexpected result Jul 5, 2019
@wrobell
Copy link
Author

wrobell commented Jul 11, 2019

Changing setup.py to use proper format character and setting strides to null in pyrobuf_list_pyx.tmp solves the issue.

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

No branches or pull requests

1 participant