Are routine objects guaranteed mutable & with dictionary?

Raymond Hettinger python at rcn.com
Sat Dec 5 04:42:55 EST 2009


On Dec 4, 2:03 am, "Alf P. Steinbach" <al... at start.no> wrote:
> Is this guaranteed to work in Python 3.x?
>
>  >>> def foo(): pass
> ...
>  >>> foo.blah = 222
>  >>> foo.blah
> 222

Yes, function attributes are guaranteed to be writable:
http://www.python.org/dev/peps/pep-0232/


Raymond





More information about the Python-list mailing list