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

Rewrite old-style class super() calls as well #305

Closed
asottile opened this issue May 13, 2020 · 3 comments · Fixed by #317
Closed

Rewrite old-style class super() calls as well #305

asottile opened this issue May 13, 2020 · 3 comments · Fixed by #317

Comments

@asottile
Copy link
Owner

For example:

class H(logging.StreamHandler):
    def __init__(self) -> None:
        logging.StreamHandler.__init__(self)
       # ...

should become

class H(logging.StreamHandler):
    def __init__(self) -> None:
        super().__init__()
        # ...
@asottile
Copy link
Owner Author

this was rolled out in 2.6.0 and then reverted in 2.6.1 -- there's some cases where some particularly odd calling constructs broke things:

class C:
    @staticmethod
    def from_other(cls, inst):
        ...

class D(C):
    def make(self):
        return C.from_other(self)

for example

@asottile
Copy link
Owner Author

via #320

@asottile
Copy link
Owner Author

and reverted again in #548 -- there isn't a safe way to implement this sadly

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

Successfully merging a pull request may close this issue.

1 participant