Vladimir Marangozov writes: >Barry, I wonder what for... In the two quoted examples, docstrings are used to store additional info about a function. SPARK uses them to contain grammar rules and the regular expressions for matching tokens. The object publisher in Zope uses the presence of a docstring to indicate whether a function or method is publicly accessible. As a third example, the optional type info being thrashed over in the Types-SIG would be another annotation for a function (though doing def f(): ... f.type = 'void' would be really clunky. >Once the puzzle would be solved, we'll discover that there would be only >one additional little step towards inheritance for modules. How weird! >Sounds like we're going to metaclass again... No, that isn't why Barry is experimenting with this -- instead, it's simply because annotating functions seems useful, but everyone uses the docstring because it's the only option. --amk
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