Skip to content

Warn when a base class has type Any due to --silent-imports #1374

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

Closed
gvanrossum opened this issue Apr 13, 2016 · 1 comment
Closed

Warn when a base class has type Any due to --silent-imports #1374

gvanrossum opened this issue Apr 13, 2016 · 1 comment

Comments

@gvanrossum
Copy link
Member

Sometimes, --silent-imports prevents importing a module that defines the base class for some other class. The other class then implicitly inherits from Any, and this means that many operations on the instances of that class are not type-checked at all. I just fixed (#1365) an issue where something was type-checked without taking this unknown base class into account, and the result was an incorrect error. However there are also plenty of situations imaginable where this situation prevents useful type-checking from happening. So perhaps we should issue a warning in this situation (i.e. a base class being undefined due to an import being suppressed due to --silent-imports). Maybe --almost-silent could be augmented to also issue these warnings.

@gvanrossum gvanrossum added this to the Undetermined priority milestone Apr 13, 2016
@gvanrossum gvanrossum removed this from the Undetermined priority milestone Mar 29, 2017
@ilevkivskyi
Copy link
Member

We now have --disallow-subclassing-any

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

No branches or pull requests

2 participants