In Chinese/14_higher_order_functions.md (around line 185), the expected output of the decorator example appears to be incorrect.
Current code:
@split_string_decorator
@uppercase_decorator # 在此情况下,装饰器的顺序很重要 - .upper()函数不适用于列表
def greeting():
return 'Welcome to Python'
print(greeting()) # WELCOME TO PYTHON
Since split_string_decorator calls split() on the uppercase string, greeting() returns a list rather than a string.
The expected output should be:
print(greeting()) # ['WELCOME', 'TO', 'PYTHON']
In
Chinese/14_higher_order_functions.md(around line 185), the expected output of the decorator example appears to be incorrect.Current code:
Since
split_string_decoratorcallssplit()on the uppercase string,greeting()returns a list rather than a string.The expected output should be: