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 - Fifth Edition

By : Steven F. Lott, Dusty Phillips
close
close
Python Object-Oriented Programming

Python Object-Oriented Programming

By: Steven F. Lott, Dusty Phillips

Overview of this book

Learn to write effective, maintainable, and scalable Python applications by mastering object-oriented programming with this updated fifth edition. Whether you’re transitioning from scripting to structured development or refining your OOP skills, this book offers a clear, practical path forward. You’ll explore Python’s approach to OOP, from class creation and inheritance to polymorphism and abstraction, while discovering how to make smarter decisions about when and how to use these tools. You’ll apply what you learn through hands-on examples and exercises. Updated for Python 3.13, this edition simplifies complex topics such as abstract base classes, testing with unittest and pytest, and async programming with asyncio. It introduces a new chapter on Python’s type hinting ecosystem—crucial for modern Python development. Written by long-time Python experts Steven Lott and Dusty Phillips, this edition emphasizes clarity, testability, and professional software engineering practices. It helps you move beyond scripting to building well-structured, production-ready Python systems. By the end of this book, you’ll be confident in applying OOP principles, design patterns, type hints, and concurrency tools to create robust and maintainable Python applications.
Table of Contents (17 chapters)
close
close
16
Index

7.1 Type hints and object-oriented programming

Almost all the examples so far have included type hints. We’ve used them for argument values in class methods. We’ve used them for return types of methods, too.

Consider a class model like the one in  Figure 7.1:

PIC
Figure 7.1: A typical class design

We’ve defined an abstract class, Polygon, and several concrete classes, Point, Rectangle, Square, and Field. We’ve referred to two built-in classes, list and float.

It’s possible, using UML, to carefully annotate the diagram with enough graphic details to make the attribute definitions redundant. Doing this can clutter the diagram with boxes and text, making it difficult to interpret.

It seems much more clear to capture the essential relationships with Python type hints than visual cues. Text such as points: list[Point] seems clear enough to help understand what a Polygon is. The...

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