© Joey Bernard 2016

Joey Bernard, Python Recipes Handbook, 10.1007/978-1-4842-0241-8_7

7. Classes and Objects

Joey Bernard

(1)Fredericton, New Brunswick, Canada

Once you have a way of storing blocks of code into reusable functions, it is a natural progression to want to bundle multiple functions together into larger blocks of reusable code called objects. Along with this actual code, you may also want to store data in the form of properties. In order to define these new objects, you need to create classes and then instantiate them into actual objects that you can use. In this chapter, you will look at some of the most common tasks that come up when you start defining and using new objects.

7-1. Discovering the Type of an Object (Everything Is an ...

Get Python Recipes Handbook: A Problem-Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.