Skip to content

Instantly share code, notes, and snippets.

@ericzhong
Created May 23, 2017 04:18
Show Gist options
  • Save ericzhong/fa6cf8b2400ef777ac25efa92d595ab4 to your computer and use it in GitHub Desktop.
Save ericzhong/fa6cf8b2400ef777ac25efa92d595ab4 to your computer and use it in GitHub Desktop.
偏函数的原理
a = int('101', base=2)
from functools import partial
b2i = partial(int, base=2)
b = b2i('101')
def btoi(x, base=2):
return int(x, base)
c = btoi('101')
print(a,b,c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment