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

newbytes.join doesn't work with generators #172

Open
posita opened this issue Sep 26, 2015 · 0 comments
Open

newbytes.join doesn't work with generators #172

posita opened this issue Sep 26, 2015 · 0 comments

Comments

@posita
Copy link
Contributor

posita commented Sep 26, 2015

Python 3.4:

>>> from __future__ import print_function, unicode_literals ; from builtins import *
>>> bytes
<class 'bytes'>
>>> bytes(b''.join(( bytes([ i ]) for i in range(10) ))) # join inside constructor works
b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t'
>>> bytes(b'').join(( bytes([ i ]) for i in range(10) )) # join outside constructor works
b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t'

Python 2.7:

>>> from __future__ import print_function, unicode_literals ; from builtins import *
>>> bytes
<class 'future.types.newbytes.newbytes'>
>>> bytes(b''.join(( bytes([ i ]) for i in range(10) ))) # join inside constructor works
b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t'
>>> bytes(b'').join(( bytes([ i ]) for i in range(10) )) # join outside constructor doesn't work
b''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants