Errors in IDE or Linter Autocompletion and Type Checking #678
Replies: 3 comments
-
Hello and thank you for your interest in Crawlee! I'm afraid this issue is not exactly actionable in this state. Could you provide an example of such error and which IDE it appears in? |
Beta Was this translation helpful? Give feedback.
-
# module_a.py
from __future__ import annotations
class ClassA:
def method_a(self) -> ClassB:
pass # module_b.py
from __future__ import annotations
from module_a import ClassA
class ClassB:
def method_b(self) -> ClassA:
pass In this setup, if your IDE (say, VS Code or PyCharm) or linter does not fully support deferred annotations, it may not recognize ClassB in method_a or ClassA in method_b as valid references. This can lead to false positive warnings like "Cannot find reference" or missing autocomplete options when trying to use ClassB or ClassA. |
Beta Was this translation helpful? Give feedback.
-
But they both do support it, right? Deferred annotations are a part of the language, and have been so for a couple of years, so if a tool does not support them, that's an issue with the tool. Is there any non-hypotethical problem we could help with? |
Beta Was this translation helpful? Give feedback.
-
Some IDEs or linters may not fully support deferred annotations, which can result in incorrect autocompletion or type-checking errors during development. This may hinder productivity, as IDEs might not recognize certain types in complex projects where multiple modules interlink, leading to a lack of suggestions or false positive warnings.
path to file -
src/crawlee/memory_storage_client/_creation_management.py
Beta Was this translation helpful? Give feedback.
All reactions