Martin McBride
Nov 18, 2020

--

The `repr` method doesn't tell Python to print a statement each time an instance of the class is called, as the article states.

`repr` is simply a method that returns a string representation of the object. It doesn't print anything.

When you type `my_car` into your console program, the console program calls `may_car.repr()` and displays the result. It is the console doing that, not something build in to Python.

--

--

Martin McBride
Martin McBride

No responses yet