Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

Course Intro & Example Python Class

Give Feedback

This lesson will show you why you would want to control how a Python class is represented. In the lesson, you’ll create a Python class and see what happens when you try to print out one of its instances to the console. The result of doing this is relatively unsatisfying.

cedricliu on July 30, 2020

Why is the return value here shows console instead of main?

Bartosz Zaczyński RP Team on Aug. 3, 2020

It’s a quirk of bpython, which is an alternative Python interpreter that Dan’s using. In addition to this, he must have had executed a module called “console.py” in an interactive mode:

$ bpython -i console.py 

The default string representation of a user-defined class is prefixed with the name of a module it was defined in.

Become a Member to join the conversation.