You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code in IPython.lib.pretty.RepresentationPrinter.pretty has a bug: it fails to look in the class __dict__s of the classes in the MRO. Fixes this is pretty easy:
--- pretty.py.orig 2012-07-11 15:38:34.000000000 +0200
+++ pretty.py 2012-07-11 15:32:05.000000000 +0200
@@ -354,7 +354,7 @@
# Some objects automatically create any requested
# attribute. Try to ignore most of them by checking for
# callability.
- if '_repr_pretty_' in obj_class.__dict__:
+ if '_repr_pretty_' in cls.__dict__:
meth = obj_class._repr_pretty_
if isinstance(meth, collections.Callable):
return meth(obj, self, cycle)
The text was updated successfully, but these errors were encountered:
is it possible to add a somewhat more meaningful testcase for this?
Its not really clear to my why the behavior tested for in the testcase is the desired behavior compared to the pre fix situation.
Getting Dummy1() as representation for Dummy2 violates the rule (convention?) that representation should be unambigous.
The code in
IPython.lib.pretty.RepresentationPrinter.pretty
has a bug: it fails to look in the class__dict__
s of the classes in the MRO. Fixes this is pretty easy:The text was updated successfully, but these errors were encountered: