Ignore str-format
error when object implements __format__()
with custom type
#17951
Labels
bug
mypy got something wrong
str-format
error when object implements __format__()
with custom type
#17951
Bug Report
I have inherited a project, where one class implements
__format__(self, format_spec: str) -> str
to implement a custom type for formatting. Runningmypy
on that code throws a false-positive error:To Reproduce
Expected Behavior
For a type implementing
__format__
mypy/checkstrformat.py should not output any error.Actual Behavior
Your Environment
Links
datetime.datetime
, which implements a rich set of custom formatters?The text was updated successfully, but these errors were encountered: