Creating and Using Objects
Python is an object-oriented language. The code in this book, however, is targeted at programmers from all walks of life, including those who aren’t used to objects—so I avoided object-oriented programming in most of this book. There are only a few examples where I used object-oriented programming, because some library required it. This short section tells you everything you need to understand those examples.
You can see a Python object as a special kind of variable. Regular variables belong to the language’s built-in types, such as float or bool. By contrast, objects belong to types that are defined by yourself, or by a library. These higher-level types are called classes.
For example, Python has no built-in type ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access