[Python-Dev] PEP 318: Set attribs with .name = value (original) (raw)

Michael Hudson mwh at python.net
Tue Mar 30 06:35:53 EST 2004


Ka-Ping Yee <python-dev at zesty.ca> writes:

Someone suggested the following syntax for setting function attributes:

def func(arg, arg): .author = 'Guido van Rossum' .version = 42

[...]

I don't really see what this has to do with PEP 318, apart from the fact that it impacts the syntax and compilation of function definitions.

PEP 318 enables this:

def func(arg1, arg2) [attrs(author='Guido van Rossum',
                            version=42)]:
    ...

which is less pretty, but also less effort.

I also thought the whole 'special syntax for function attributes' discussion was very dead indeed.

Cheers, mwh

-- You have run into the classic Dmachine problem: your machine has become occupied by a malevolent spirit. Replacing hardware or software will not fix this - you need an exorcist. -- Tim Bradshaw, comp.lang.lisp



More information about the Python-Dev mailing list