pythontutor-dev / pythontutor

11 stars 4 forks source link

If a class overrides __class__, its instances are misidentified #106

Closed wjandrea closed 1 year ago

wjandrea commented 4 years ago

It seems like PythonTutor is getting the class name from instance.__class__ instead of type(instance).

permanent link

Visualizer screenshot:

visualizer showing "ClassA instance"

Python 3 and 2 are both affected.

Code is modified from this Stack Overflow answer.

wjandrea commented 1 year ago

NVM. I just saw this under Unsupported features:

Advanced language features or subtleties that only experts need to know (this is a tool for teaching novices)