Last active
August 29, 2015 13:57
-
-
Save dstufft/9821953 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # thing = Can be a bytes instance, or something that yields bytes instances | |
| for x in thing: | |
| if isinstance(x, int): | |
| x = bytes((x,)) | |
| # Do the actual work | |
| pass | |
| for x in map(lambda x: bytes((x,)) if isinstance(x, int) else x, thing): | |
| # Do the actual work | |
| pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment