16.7. Classes as types¶
As we have seen, in Python all variables have a type. We can use the built-in
dir function to examine the capabilities of a variable. We can also use
dir with the classes that we create.
You can see that using the
class keyword, we have created a new type.
dir output, you can see both the
x integer attribute and the
method are available in the object.