Side note: When you’re posting code, please enclose the code fragments between lines consisting only of three backtick - ` characters. That means you would have one line of ```, followed by your lines of code, followed by another line of ```.
Example:
# The line above this one is ```
def function(self):
return self
# The line below this one is ```
As you can see, “fencing” your code like this allows it to maintain its formatting, making it much easier to read.
Ken