-
I'm trying to add some type hints to my functions, e.g. However, I am getting this pesky warning from IDEA: Am I doing something wrong? 😓 What am I missing? |
Beta Was this translation helpful? Give feedback.
Answered by
nejch
Feb 22, 2024
Replies: 1 comment 4 replies
-
This would be perfectly fine for mypy. I guess you're hitting a pycharm/IDEA bug where it expects that package exposed via https://stackoverflow.com/questions/23248017/cannot-find-reference-xxx-in-init-py You can probably work around it by importing it directly. Dummy code: from gitlab.v4.objects import Project
def get_project(project: Project) -> None
pass |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
stdedos
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This would be perfectly fine for mypy. I guess you're hitting a pycharm/IDEA bug where it expects that package exposed via
__all__
:https://stackoverflow.com/questions/23248017/cannot-find-reference-xxx-in-init-py
You can probably work around it by importing it directly. Dummy code: