Hallvard B Furuseth
h.b.furuseth at usit.uio.no
Sun Aug 8 01:49:37 CEST 2004
Yawar Amin wrote:
> How about
> def foo(a, b, c):
> foo.accepts = (int, int, list)
> foo.author = 'Chris King'
That already has a different meaning: Function foo sets those attributes
on itself each time it is called. They should be set once, before the
function is called.
>>> def foo(a, b, c):
... foo.accepts = (int, int, list)
... foo.author = 'Chris King'
Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: 'function' object has no attribute 'author'
More information about the Python-list