You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fill and align string format specifiers do not currently have type checking, but are not supported by all types. Specifically, None does not support them.
Pitch
I ran into a bug where an optional type was being passed to string formatting using <. This would succeed most of the time, but error if the value was None:
>>> "{:<2}".format(None)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported format string passed to NoneType.__format__
It would be great if mypy would catch this code as a type violation.
I attempted to implement here: #18799 but this was more challenging than I anticipated and I am a first time contributor.
Thanks.
The text was updated successfully, but these errors were encountered:
Feature
The fill and align string format specifiers do not currently have type checking, but are not supported by all types. Specifically,
None
does not support them.Pitch
I ran into a bug where an optional type was being passed to string formatting using
<
. This would succeed most of the time, but error if the value was None:It would be great if mypy would catch this code as a type violation.
I attempted to implement here: #18799 but this was more challenging than I anticipated and I am a first time contributor.
Thanks.
The text was updated successfully, but these errors were encountered: