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

Cannot subclass Chart #41

Closed
someidiot opened this Issue Sep 8, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@someidiot

someidiot commented Sep 8, 2016

I get stack overflow when trying to extend the Chart class due to the way the superclass is called in Chart.init. Using self.class causes problems, see http://stackoverflow.com/questions/18208683/when-calling-super-in-a-derived-class-can-i-pass-in-self-class

@atodorov

This comment has been minimized.

Contributor

atodorov commented Sep 14, 2016

@someidiot - this is an easy fix but can you post a reproducer so I can make a test for this.

The SO thread sounds about right but I've had the habit of using self.__class__ for quite a long time and haven't seen such problems. It bugs me I may have been doing it wrong the whole time and I want to investigate in details. Thanks.

@atodorov

This comment has been minimized.

Contributor

atodorov commented Sep 14, 2016

FYI I have also sent a PR to pylint for this error. It looks like they also had a regression in detecting super(type(self)) but that's another story, see PyCQA/pylint#1109

@someidiot

This comment has been minimized.

someidiot commented Sep 26, 2016

Awesome, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment