Last active
August 29, 2015 13:59
-
-
Save adoc/10487972 to your computer and use it in GitHub Desktop.
This file contains 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
def qbytes(*args): | |
"""Accepts argument list of variables that might be bytes and | |
decodes, otherwise passing the value through.""" | |
# This is a bit hackish and the static-typers are throwing their | |
# hands up. :P | |
return tuple([arg.decode() | |
if isinstance(arg, bytes) | |
else arg | |
for arg in args]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment