-
-
Notifications
You must be signed in to change notification settings - Fork 145
Closed
Labels
Description
The value
parameter of Timedelta
currently has the following type-hint:
value: str | int | Timedelta | timedelta | np.timedelta64 = ..., |
I think it should also accept float, so that type checkers won't complain on following code snippet:
import pandas as pd
pd.Timedelta(3.5, 'hours')
Argument of type "float" cannot be assigned to parameter "value" of type "str | int | Timedelta | timedelta | timedelta64" in function "__new__"
Type "float" is not assignable to type "str | int | Timedelta | timedelta | timedelta64"
"float" is not assignable to "str"
"float" is not assignable to "int"
"float" is not assignable to "Timedelta"
"float" is not assignable to "timedelta"
"float" is not assignable to "timedelta64"
Pylance[reportArgumentType](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportArgumentType)