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.