From https://docs.python.org/3/reference/expressions.html#calls
The primary must evaluate to a callable object (user-defined functions, built-in functions, methods of built-in objects, class objects, methods of class instances, and all objects having a
__call__()
method are callable).
- Does "class objects" refer to "instances of classes" or "classes themselves as objects"? I guess it tries to mean the latter, but the wording seems to mean the former. If I am correct, in C++ and Java, objects always mean instances of some classes, and that is probably the cause of my confusion. What are some names that are used to refer to "instances of classes"?
Does "methods of class instances" mean "functions as attributes of instances of some classes" or "functions as attributes of some classes which operate on instances of the classes"? I guess it tries to mean the latter, but the wording seems to mean the former. An instance of a class may have an attribution which isn't an attribute of the class and which is a function:
class C: pass c=C() def f(): pass c.myfun=f
where
c.myfun
is a function attribute of instancec
, not a function attribute of classC
.What are some names commonly used to refer to the attribute of an instance of a class, which is not an attribute of a class?
Thanks.