Skip to content

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

Open
Allianzcortex wants to merge 5 commits intoegrcc:masterfrom
Allianzcortex:master
Open

使用 @decorators 装饰器 来简化函数#65
Allianzcortex wants to merge 5 commits intoegrcc:masterfrom
Allianzcortex:master

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