Skip to content

Glossary: Python Beyond the Basics

__repr__

Also written: repr, representation

A special method that returns the text Python shows when you print an object. Without it you see something like `<__main__.GiftCard object at 0x10a3f2b50>`.

Where the book teaches it

Related terms

special method!rdataclass