Jim> (1) Eventually, there will be another good idea. Jim> Therefore, we should define a general extension syntax, rather than Jim> a special case for this particular extension. Jim> def func(args) [wrapper1, wrapper2]: Jim> uses up the syntax forever. Jim> def func(args) mods [wrapper1, wrapper2]: Jim> allows later extensions like Jim> def func(args) alias [wrapper1, wrapper2]: Jim> def func(args) compiler_hints [wrapper1, wrapper2]: Jim> def func(args) my_domain_special_use [wrapper1, wrapper2]: I don't think the second version is needed. Consider the compiler_hints extension: def func (args) [hint1, hint2]: pass def hint1(func): func.hint1 = True return func def hint2(func): mess_with_func.func_code() return func There's no requirement that the decorations have to return a different function. They can return the same function and just operate through side effects on the input function. Skip
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4