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

split() could also split into constant length chunks #31

Closed
GoogleCodeExporter opened this issue Apr 11, 2015 · 2 comments
Closed

split() could also split into constant length chunks #31

GoogleCodeExporter opened this issue Apr 11, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

The first parameter of split() could be an integer, which would then mean
that it would return a generator for constant sized chunks. For example

for byte in s.split(8):
  do_something_with(byte)


Original issue reported on code.google.com by python.bitstring@googlemail.com on 5 Jun 2009 at 8:30

@GoogleCodeExporter
Copy link
Author

Resolved in revision 357.

Introduced 'cut' function rather than overloading split. So use

for byte in s.cut(8):
  ...

Original comment by python.bitstring@googlemail.com on 9 Jun 2009 at 9:30

  • Changed state: Verified

@GoogleCodeExporter
Copy link
Author

Thanks for the explanation for 'cut' function

Original comment by afarha...@gmail.com on 30 Aug 2009 at 12:42

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

1 participant