Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pretty reprs of super() objects #5003

Merged
merged 2 commits into from Feb 4, 2014

Conversation

takluyver
Copy link
Member

Prompted by this SO question.

The problem:

In [1]: class A(object):
    pass
   ...: 

In [2]: class B(A): pass

In [3]: class C(B): pass

In [4]: c = C()

In [5]: super(B, c)
Out[5]: <super: __main__.C, <__main__.C at 0x2a772d0>>

In [6]: repr(super(B, c))
Out[6]: "<super: <class 'B'>, <C object>>"

In [7]: super(B)
Out[7]: <super: None, None>

In [8]: repr(super(B))
Out[8]: "<super: <class 'B'>, NULL>"

Afterwards:

In [6]: super(B, c)
Out[6]: <super: __main__.B, <__main__.C at 0x1fbb6d0>>

In [7]: super(B)
Out[7]: <super: __main__.B, None>

@takluyver takluyver added this to the 2.0 milestone Feb 4, 2014
@ellisonbg
Copy link
Member

@takluyver the code looks fine here, but the tests are failing with a probably unrelated JS test. Do you want to rebase on master to see if that will pass, or should we just merge and pray?

@takluyver
Copy link
Member Author

We're seeing JS test failures quite frequently at the moment - I think @jdfreder and @minrk are working on making that better. However, not much prayer is needed in this case - there's no way that the JS tests are going to be affected by the representation of super objects.

@ellisonbg
Copy link
Member

OK, I think all the PR related to test stability are in, so I am going to merge this one. If there is a problem in master we can clean it up...

ellisonbg added a commit that referenced this pull request Feb 4, 2014
Fix pretty reprs of super() objects
@ellisonbg ellisonbg merged commit f98dd14 into ipython:master Feb 4, 2014
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants