Python String Conversion 101: Why Every Class Needs a “repr”
How and why to implement Python “to string” conversion in your own classes using Python’s “repr” and “str” mechanisms and associated coding conventions.
How and why to implement Python “to string” conversion in your own classes using Python’s “repr” and “str” mechanisms and associated coding conventions.
In this short screencast I’ll walk you through a simple code example that demonstrates how you can use custom exception classes in your Python code to make it easier to understand, easier to debug, and more maintainable.
Maybe you’ve been using Python for a while now and you’re starting to feel like you’re getting the hang of it. But one day you catch yourself thinking: “What about classes?”
Abstract Base Classes (ABCs) ensure that derived classes implement particular methods from the base class. In this tutorial you’ll learn about the benefits of abstract base classes and how to define them with Python’s built-in abc module.
Python String Conversion 101: Why Every Class Needs a “repr”
Make your Python code more readable with custom exception classes
6 things you’re missing out on by never using classes in your Python code
Abstract Base Classes in Python
Some of the best content I post is email only. Join over 18,144 other Python developers on my (free) weekly newsletter →
📰 Learn More »