Last active
August 29, 2015 14:04
-
-
Save dplepage/64346ac0a338e9c914a9 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
byte_aware_dfy = GraphDispatcher([dictify]) | |
byte_aware_udfy = GraphDispatcher([undictify]) | |
@byte_aware_dfy.when(Bytes) | |
def df_bytes(dispgraph, value, **kwargs): | |
return value.decode('utf-8') | |
@byte_aware_udfy.when(Bytes) | |
def udf_bytes(dispgraph, value, **kwargs): | |
return value.encode('utf-8') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment