Python Data Model
Magic Methods in Python Classes12 H 44 M
Just you? Training a whole team? There's an ITProTV plan that fits.
Start Training TodayEpisodes
Episodes
- Basics
- Overview
- Creating and Initializing an Instance
- Representing an Instance: str and repr
- Representing an Instance: format
- Representing an Instance: bytes
- Deleting an Instance
- Containers
- Objects as Iterables
- Getting Items
- Setting and Deleting Items
- Comparables
- Obtaining the Boolean Representation
- Equality and Inequality
- Greater and Less
- Hashing and Slots
- Numbers
- Adding
- Subtracting
- Multiplying
- Dividing
- Modulo and Powers
- Bit Shifting Operations
- Bitwise Logical Operations
- Negative and Positive
- Absolute Value and Inverse
- Integers and Floats
- Rounding
- Floor and Ceiling
- Truncation and Indexing
- Complex Number
- Attributes
- Getting Attributes
- Setting and Deleting Attributes
- Descriptors: Property Decorators
- Descriptors: Creating a Custom Descriptor
- Functions
- Making an Object Callable
- Context Managers
- Clean Up with Context Managers
- Serialization
- Copying Objects
- Pickling: Get and Set State
Overview
2 M



- Episode Description
- Transcript
Python has a set of protocols that the language internally adhere to which provides the functionality for features such as iteration, context manager behavior, string representation of an object, and many other things. When you create custom classes in Python and make use of these protocols then you can create custom behavior in the context of iterations, types, comparison of objects, operator overloading, and much more. Knowing about these will help level up your Python skills. If you are ready to progress forward in your Python prowess, then join us to learn more about the Python data model.