I am new to Python. I am familiar with Java, C/C++, and OCaml. I understand Lambda Calculus and elementary Type Theory because of a Programming Languages course I took at Un
Because the notion of type is the same as class you can subclass type with normal object-oriented techniques and class syntax to customize it.
And because classes are really instances of the type class, creating classes from customized subclasses of type allows to implement custom kinds of classes.
In new-style classes:
It is talking specifically about the object type
. For type
, all types inherit from <type 'type'>
.
I believe the other statement is just pointing out that <type 'type'>
is an object
; an example I thought of from looking further down:
t = list.__class__ # <type 'type'>
t.__bases__ # (<type 'object'>,)