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

super(type, cls).__new__ saying not an instance when it is #7595

Open
euresti opened this issue Oct 1, 2019 · 1 comment
Open

super(type, cls).__new__ saying not an instance when it is #7595

euresti opened this issue Oct 1, 2019 · 1 comment
Labels
bug mypy got something wrong priority-1-normal

Comments

@euresti
Copy link
Contributor

euresti commented Oct 1, 2019

When upgrading to the latest mypy I started getting a weird new error. Here's a simplified example:

class X:
    def __new__(cls) -> "X":
        return super(type, cls).__new__(cls)    # error: Argument 2 for "super" not an instance of argument 1

However:

>>> isinstance(X, type) 
True

My settings: mypy 0.730

[mypy]
python_version=3.6
incremental=True
ignore_missing_imports=True
follow_imports=normal
warn_redundant_casts=True
warn_unused_ignores=True
strict_optional=True
no_implicit_optional=True
disallow_untyped_defs=True
disallow_any_generics=True

(Note: I'm using super to skip an inherited __new__ when I create the object.)

@msullivan msullivan added the bug mypy got something wrong label Oct 2, 2019
@and-semakin
Copy link

Possible duplicate of #9282

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong priority-1-normal
Projects
None yet
Development

No branches or pull requests

4 participants