Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Python Object-Oriented Programming
  • Table Of Contents Toc
Python Object-Oriented Programming

Python Object-Oriented Programming - Fourth Edition

By : Steven F. Lott, Dusty Phillips
3.9 (34)
close
close
Python Object-Oriented Programming

Python Object-Oriented Programming

3.9 (34)
By: Steven F. Lott, Dusty Phillips

Overview of this book

Python Object-Oriented Programming, Fourth Edition is a practical guide to advancing your OOP skills with modern Python. Going beyond the fundamentals, it helps you work with Python as an OOP language, explore both common and advanced design patterns, and apply these concepts to data manipulation and testing of complex OOP systems. Each chapter features newly written open-ended exercises as well as a real-world case study, aligned with the improvements in Python 3.11—bringing faster execution and memory efficiency to your applications. Authors Steven F. Lott and Dusty Phillips provide a comprehensive, illustrative tour of important OOP concepts, such as inheritance, composition, and polymorphism, showing how they integrate with Python’s classes and data structures to facilitate good design. The book also introduces two powerful automated testing systems, unittest and pytest, and explores Python's concurrent programming ecosystem in depth. By the end of the book, you’ll have a thorough understanding of how to think about and apply object-oriented principles using Python syntax to create robust and reliable programs.
Table of Contents (17 chapters)
close
close
15
Other Books You May Enjoy
16
Index

Operator overloading

Python's operators, +, /, -, *, and so on, are implemented by special methods on classes. We can apply Python operators more widely than the built-in numbers and collection types. Doing this can be called "overloading" the operators: letting them work with more than the built-in types.

Looking back at the The collections.abc module section, earlier in this chapter, we dropped a hint about how Python connects some built-in features with our classes. When we look at the collections.abc.Collection class, it is the abstract base class for all Sized, Iterable, Containers; it requires three methods that enable two built-in functions and one built-in operator:

  • The __len__() method is used by the built-in len() function.
  • The __iter__() method is used by the built-in iter() function, which means it's used by the for statement.
  • The __contains__() method is used by the built-in in operator. This operator is implemented by methods...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Python Object-Oriented Programming
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon