学python时候对于这种闭包还算能理解
def max_length(n):
def validator(s):
if len(s) < n:
return
raise Exception('Length of string must be less than {0}!'.format(n))
return validator
但如果是这种:
就不知道该如何运行了,因为嵌套太多函数了
学python时候对于这种闭包还算能理解
def max_length(n):
def validator(s):
if len(s) < n:
return
raise Exception('Length of string must be less than {0}!'.format(n))
return validator
但如果是这种:
就不知道该如何运行了,因为嵌套太多函数了
1 回答1.7k 阅读✓ 已解决
4 回答970 阅读
1 回答713 阅读
1 回答694 阅读
1 回答521 阅读
642 阅读
586 阅读
不知道该如何运行为什么要写呢?另外你的问题排版没做好。