Real Python Tutorials

Custom Python Strings: Inheriting From str vs UserString
NEW

Custom Python Strings: Inheriting From str vs UserString

In this tutorial, you'll learn how to create custom string-like classes in Python by inheriting from the built-in str class or by subclassing UserString from the collections module.

Sep 28, 2022 intermediate python

— FREE Email Series —

🐍 Python Tricks 💌

Python Tricks Dictionary Merge

🔒 No spam. Unsubscribe any time.