Skip to content

Support type hinting #1559

Closed

Description

@q-wertz

Is your feature request related to a problem? Please describe.
Currently type hinting is not supported by folium. Are there any plans to implement this?

Describe the solution you'd like
Typing in folium and type hints for the public interfaces (Maybe autogenerated)

Describe alternatives you've considered
Excluding folium in my personal project from type checking by mypy

Additional context
None

Implementation
folium is maintained by volunteers. Can you help make a PR if we want to implement this feature?
-> Can try to help with this

Activity

  1. Conengmo commented on Jan 6, 2022

    @Conengmo
    Member

    Yes, that would be nice. Though type hints in folium are not that useful, since we use a lot of duck-typing. I was working on a change a while back: #1297

  2. q-wertz commented on Jan 6, 2022

    @q-wertz
    Author

    Ah sorry, didn't see the PR only searched the issues.

    Is it not merged due to a certain reason or just not finished?

  3. Conengmo commented on Jan 6, 2022

    @Conengmo
    Member

    Just not finished. I think we could finish it this time around.

  4. q-wertz commented on Jan 6, 2022

    @q-wertz
    Author

    If you need testing or something I can help with let me know

  5. added
    enhancement
    on Nov 17, 2022
  6. q-wertz commented on Nov 6, 2023

    @q-wertz
    Author

    After updating folium to 0.15.0 mypy still says:

    plots.py:11: error: Skipping analyzing "folium": module is installed, but missing library stubs or py.typed marker  [import-untyped]
    plots.py:11: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
    

    Not a pro in this, but I think you need to add an (empty) py.typed file in the folium folder. (At least mypy stops giving the error message as soon as I add it manually in my venv folium lib...

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions