Skip to content

Errors in IDE or Linter Autocompletion and Type Checking #645

Description

@mgunawardhana

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

Activity

  1. added
    t-toolingIssues with this label are in the ownership of the tooling team.
    on Nov 2, 2024
  2. janbuchar commented on Nov 2, 2024

    @janbuchar
    Collaborator

    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?

  3. mgunawardhana commented on Nov 3, 2024

    @mgunawardhana
    Author
    # 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.

  4. janbuchar commented on Nov 4, 2024

    @janbuchar
    Collaborator

    In this setup, if your IDE (say, VS Code or PyCharm) or linter does not fully support deferred annotations, it may not recognize...

    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?

  5. locked and limited conversation to collaborators on Nov 11, 2024
  6. converted this issue into a discussion #678 on Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    t-toolingIssues with this label are in the ownership of the tooling team.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions