A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-April/003365.html below:

[Python-Dev] Arbitrary attributes on funcs and methods

[Python-Dev] Arbitrary attributes on funcs and methods [Python-Dev] Arbitrary attributes on funcs and methodsAndrew Kuchling akuchlin@mems-exchange.org
Wed, 12 Apr 2000 08:22:26 -0400 (EDT)
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