Snippets tagged “repr”
2 snippets use this tag.
- How to get a function name as a string?Python
In Python, you can use the built-in function attribute __name__ to get the name of a function as a string.
- What is the difference between __str__ and __repr__?Python
__str__ and __repr__ are two special methods in Python classes.