I’m noob in python and trying to get some details. So I was reading Python Types and Objects by Shalabh Chaturvedi , when the whole small book made sense to me I encountered this para.
There are two kinds of objects in Python:
1.Type objects – can create instances, can be subclassed.
2.Non-type objects – cannot create instances, cannot be subclassed.
….
….
To create a new object using subclassing, we use the class statement and specify the
bases (and, optionally, the type) of the new object. This always creates a type object.To create a new object using instantiation, we use the call operator (()) on the type object
we want to use. This may create a type or a non-type object, depending on which type
object was used.
last para with italicized text totally eluded me. I thought calling someTypeObject()
always created instance of type object.
Thanks
Googled , tried chat GPT but couldn’t get proper answer