-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
mypy Type error for a class with an imported metaclass #9185
Comments
I think this is a bug, mypy is likely confused by the custom metaclass and doesn't apply the usual enum special-casing. Likely this is easy to fix. The relevant code is in |
This may be key. Is there a stub for that pip package? Or does it have a |
If the |
hey @ilevkivskyi . Seems like this issue is still open. Can I take it?? |
@Kaushal-Dhungel sure, go head. |
Hi sir, Can I take it to solve the problem? |
Hi there I am Shivam, I know Python to an intermediate level, |
@Hyperion101010 Done! |
Hi, just curious if the issue is being solved/ has been solved, if not I'd love to give it a shot! |
I'd like to tackle this issue. |
Hi there, I have been trying to contribute to mypy for weeks, but I am intermediate in the Python. I was trying to understand the code in the semanal.py, but it is hard to understand where the problem is. Can you give me tips where should I look so I can try to solve this issue? |
Hi there - I'd like to try my hand at this issue. @ilevkivskyi @JukkaL could I claim this issue? |
@quinnah Yes, sure, you can give it a try. |
Hey @ilevkivskyi, sorry I don't think I'll have time to work on this :/ |
OK, NP |
Please provide more information to help us understand the issue:
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
Here is an example class I am working with.
I am making a change where I am importing the
MyEnumMetaClass
class from a PIP package now, whereas before it was located within the same project as this class.With
MyEnumMetaClass
imported, whenever I create aMyEnumClass
instance, mypy gives me the following error:error: The type "Type[MyEnumClass]" is not generic and not indexable
I expect mypy to succeed here, given that the code is the same, it is just imported from a package now.
The text was updated successfully, but these errors were encountered: