- [Narrator] Using special class methods,…you can give your classes abilities…that they don't natively get from Python,…but that other build-in objects have.…One of those is the ability to emulate the behavior…of numeric values in order…to support operations like addition and subtraction.…This table shows a partial list of…the functions your class can override in order…to provide number-like functionality.…You can add objects together,…subtract them from each other,…basically, just about any mathematical operation you want.…You can see in the right hand column the kinds of…expressions that cause these functions to be called,…such as when two objects are added together.…
In addition, Python also supports…in-place math operations on objects.…These functions are called when you use…the short-hand notation such as plus equals…in order to add to an existing object in place.…And again, this is not an exhaustive list.…If you want to learn more about these functions,…you can check out the data model chapter…in the Python documentation.…
- Truth value testing
- Template strings
- Advanced Python functions
- Advanced collections
- Advanced classes and objects
- Python comprehensions: list, dictionary, and set
Skill Level Advanced
1. Python Language Features
2. Built-In Functions
3. Advanced Python Functions
4. Advanced Collections
5. Advanced Classes and Objects
6. Using Logging
7. Python Comprehensions
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.