Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用 @decorators 装饰器 来简化函数 #65

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

使用 @decorators 装饰器 来简化函数 #65

wants to merge 5 commits into from

Conversation

Allianzcortex
Copy link

use @decorators to simplify the structure of code

@decorators 装饰器为例,来简化操作。避免在每次调用函数前用 if 语句来判断是否执行 parse() 函数。

仅仅是一个 demo:-) 以 get_post_count() 作为例子。如果 @egrcc 觉得这种方式可以推广的话欢迎采纳~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant