学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
但如果是这种:
就不知道该如何运行了,因为嵌套太多函数了
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
不知道该如何运行为什么要写呢?另外你的问题排版没做好。