Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set your subtitle preferences 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 refer to our video player troubleshooting guide for assistance.

Course Intro & Example Python Class

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.

Cedric Liu 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.