Skip to content

Missing type hints for matplotlib.dates.DateFormatter #29994

Open
@johnthagen

Description

@johnthagen

Using this code:

from matplotlib.dates import DateFormatter

date_fmt = "%H:%M:%S"
date_formatter = DateFormatter(date_fmt)

Running Mypy in strict mode results in an erorr:

$ mypy --strict main.py 
main.py:4: error: Call to untyped function "DateFormatter" in typed context  [no-untyped-call]
Found 1 error in 1 file (checked 1 source file)

We run Mypy in strict mode across all of our code base to catch programming errors and would like to use it with matplotlib without the need to suppress errors like this.

Environment

  • Python 3.11.11
  • matplotlib 3.10.1
  • mypy 1.15.0

Related References

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions