Russell Finn wrote: > Mike Rovner wrote: > > > I came up with nearly the same idea after reading Guido's original post, > except that I recommend using the existing dictionary literal syntax: > > def func (args): > { author: "Guido", deprecated: True} > '''doc''' > pass > > Perhaps this was just a typo in Mike's post. What should happen in this case? mod_author = "Guido" author = 5 def func(self, author, mod_author): { author: mod_author} func("Paul", "Bill") Does the func get: func.author = "Guido" or func.5 = "Guido" or func.Paul = "Bill" or ... A better solution is: def func(self, author, mod_author){ author: mod_author }: Although this particular example is confusing because of the reused argument names, it is still reasonably clear that the decorator is evaluated at _definition time_ not _function run time_. Paul Prescod
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