To do that you can subclass str.
However, while technically possible, most of the time you are subclassing builtins (such as str) you are looking at a 'has-a' kind of relationship, not 'is-a', therefore composition should be used, not inheritance (meaning you should create a class with a string as an instance attribute, rather than subclass string).