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

Treat bytearray as bytes in Python 3, same as in Python 2 #49

Merged
merged 1 commit into from Mar 14, 2018
Merged

Treat bytearray as bytes in Python 3, same as in Python 2 #49

merged 1 commit into from Mar 14, 2018

Conversation

matejcik
Copy link
Contributor

This seems to be the right thing to do. In python2, bytearray is treated as a string. In python3, the code kinda-sorta-explicitly excludes bytearray, but that results in bytearray being treated as a list. Hence, encoding bytearray('hello') in python 2 decodes to 'hello' but doing the same in python 3 decodes to [b'h', b'e', b'l', b'l', b'o'].

This PR unifies the behavior, in a direction that I think makes more sense.

@coveralls
Copy link

coveralls commented Mar 14, 2018

Coverage Status

Coverage increased (+0.03%) to 82.59% when pulling 97ebad8 on matejcik:develop into 63b4880 on ethereum:develop.

@pipermerriam pipermerriam merged commit e4f4a26 into ethereum:develop Mar 14, 2018
pacrob pushed a commit to pacrob/pyrlp that referenced this pull request Sep 21, 2023
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.

None yet

3 participants