For example, in С++ concept of a class exists only before compilation, then the compiler sticks together everything and optimizes it. In Java class is something more specific that exists even after compilation. How are classes organized in Python ?
Closed due to the fact that the issue is too common for the participants aleksandr barakin , HamSter , Denis , pavel , αλεχολυτ 11 Nov '16 at 8:50 .
Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .
1 answer
In python class is a complete object during program execution. You can change a class variable, for example. Then all instances created on the basis of this class (if they use the class variable) will use the new value.
The class definition is an executable instruction:
Class definitions, like function definitions (def statements) must be executed. (You could conceivably place a function in a statement. If
After executing such an instruction, a class object is created:
When a class definition is left normally (via the end), a class object is created.
More details can be read, for example python2 documentation .
c_ubyte * sizeof(obj)), an example for int - jfs