Someone suggested the following syntax for setting function attributes: def func(arg, arg): .author = 'Guido van Rossum' .version = 42 Guido replied that he wanted to reserve ".name = value" for use in "with" blocks. These two uses are not in conflict at all -- in fact, they are perfectly compatible and i find the syntactic consistency elegant. I think the above syntax for function metadata is by far the cleanest and simplest method i have seen, and its meaning is the most obvious of all the proposed syntaxes. After "def func...: .version = 42" it makes sense that func.version should equal 42. I am also happy with the idea of "with": with some[long].expression: .attrib = .something + something It all fits together beautifully. def func(arg, arg) [optimized, classmethod]: .author = 'Sir Galahad' .version = 42 """Description.""" code more code -- ?!ng
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