Another suggested syntax for inlining attributes, by Aaron Digulla.
This commit is contained in:
parent
777bc87f27
commit
11a0deaf25
11
pep-0232.txt
11
pep-0232.txt
|
@ -99,8 +99,7 @@ Open Issues
|
|||
2) __doc__ is the only function attribute that currently has
|
||||
syntactic support for conveniently setting. It may be
|
||||
worthwhile to enhance the language for supporting easy function
|
||||
attribute setting. One suggestion that has been raised in
|
||||
previous discussions is this syntax:
|
||||
attribute setting. Here are some suggested syntaxes:
|
||||
|
||||
def a {
|
||||
'publish' : 1,
|
||||
|
@ -109,8 +108,12 @@ Open Issues
|
|||
(args):
|
||||
# ...
|
||||
|
||||
I.e., that a dictionary literal placed between the function
|
||||
name and the argument parentheses be assigned to func_dict.
|
||||
def a(args):
|
||||
"""The usual docstring."""
|
||||
{'publish' : 1,
|
||||
'unittest': '''...''',
|
||||
# etc.
|
||||
}
|
||||
|
||||
It isn't currently clear if special syntax is necessary or
|
||||
desirable.
|
||||
|
|
Loading…
Reference in New Issue