[Python-ideas] Add a dict with the attribute access capability
greg.ewing at canterbury.ac.nz
Thu Nov 30 17:19:49 EST 2017
Ivan Pozdeev via Python-ideas wrote:
> I needed to hold an external function
> reference in an object instance (if I assigned it to an attribute, it
> was converted into an instance method).
No, that only happens to functions stored in *class* attributes,
not instance attributes.
>>> class A:
>>> a = A()
>>> def f():
... print("I'm just a function")
>>> a.x = f
I'm just a function
More information about the Python-ideas