Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Expert Python Programming – Fourth Edition

You're reading from   Expert Python Programming – Fourth Edition Master Python by learning the best coding practices and advanced programming concepts

Arrow left icon
Product type Paperback
Published in May 2021
Publisher Packt
ISBN-13 9781801071109
Length 630 pages
Edition 4th Edition
Languages
Arrow right icon
Authors (3):
Arrow left icon
Michał Jaworski Michał Jaworski
Author Profile Icon Michał Jaworski
Michał Jaworski
Tarek Ziade Tarek Ziade
Author Profile Icon Tarek Ziade
Tarek Ziade
Tarek Ziadé Tarek Ziadé
Author Profile Icon Tarek Ziadé
Tarek Ziadé
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Current Status of Python 2. Modern Python Development Environments 3. New Things in Python 4. Python in Comparison with Other Languages 5. Interfaces, Patterns, and Modularity FREE CHAPTER 6. Concurrency 7. Event-Driven Programming 8. Elements of Metaprogramming 9. Bridging Python with C and C++ 10. Testing and Quality Automation 11. Packaging and Distributing Python Code 12. Observing Application Behavior and Performance 13. Code Optimization 14. Other Books You May Enjoy
15. Index

Summary

This chapter was a journey through time. Python is considered a modern language but in order to better understand its patterns, we had to make some historical trips.

We started with interfaces—a concept almost as old as object-oriented programming (the first OOP language—Simula—dates to 1967!). We took a look at zope.interface, something that is probably one of the oldest actively maintained interface libraries in the Python ecosystem. We learned some of its advantages and disadvantages. That allowed us to really embrace two mainstream Python alternatives: abstract base classes and structural subtyping through advanced type annotations.

After familiarizing ourselves with interfaces, we looked into inversion of control. Internet sources about this topic can be really confusing and this concept is often confused with dependency injection. To settle any disputes, we traced the origin of the term to the 80s, when no one had yet ever dreamed about dependency injection containers. We learned how to recognize inversion of control in various forms and saw how it can improve the modularity of applications. We tried to invert control in a simple application manually. We saw that sometimes it can cost us readability and expressiveness. Thanks to this, we are now able to fully recognize the value that comes from the simplicity of ready-made dependency injection libraries.

The next chapter should be refreshing. We will completely move away from the topics of object-oriented programming, language features, design patterns, and paradigms. It will be all about concurrency. We will learn how to write code that does a lot, in parallel, and—hopefully—does it fast.

You have been reading a chapter from
Expert Python Programming – Fourth Edition - Fourth Edition
Published in: May 2021
Publisher: Packt
ISBN-13: 9781801071109
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image