[Python-Dev] Re: PEP 318 bake-off? (original) (raw)
Phillip J. Eby pje at telecommunity.com
Thu Apr 1 14:10:39 EST 2004
- Previous message: [Python-Dev] Re: PEP 318 bake-off?
- Next message: [Python-Dev] Re: PEP 318 bake-off?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At 01:54 PM 4/1/04 -0500, David Goodger wrote:
Phillip J. Eby wrote:
Next, does anybody have any actual use cases for attribute decoration today? If you mean function attributes, Docutils uses them a lot. They're described in <http://docutils.sf.net/docutils/parsers/rst/directives/init.py> and used in all the modules in that directory, such as <docutils/docutils/parsers/rst/directives/images.py>.
Thanks! So for example, this:
def admonition(*args): return make_admonition(nodes.admonition, *args)
admonition.arguments = (1, 0, 1) admonition.options = {'class': directives.class_option} admonition.content = 1
def attention(*args): return make_admonition(nodes.attention, *args)
attention.content = 1
might be rephrased as (say):
as [rst_directive( arguments=(1,0,1), options={'class': directives.class_option}, content=1 ) ] def admonition(*args): return make_admonition(nodes.admonition, *args)
as [rst_directive(content=1)] def attention(*args): return make_admonition(nodes.attention, *args)
- Previous message: [Python-Dev] Re: PEP 318 bake-off?
- Next message: [Python-Dev] Re: PEP 318 bake-off?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]