Skip to content

Instantly share code, notes, and snippets.

@SpikeXy
Last active October 2, 2017 01:49
Show Gist options
  • Save SpikeXy/97ca4a931ad879117c365c2d71a72234 to your computer and use it in GitHub Desktop.
Save SpikeXy/97ca4a931ad879117c365c2d71a72234 to your computer and use it in GitHub Desktop.
functools #python
# 使用functools.partial创建新的函数
>>> import functools
>>> int2 = functools.partial(int, base=2)
>>> int2('1000000')
64
>>> int2('1010101')
85
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment