Open baadal-bharosa opened 5 years ago
I feel that returning None is a predictable output.
Sorry for not expressing the thought fully.
By "predictable output" what I implied was to get an output that is still a function of the input.
Instead of None
which is invariant.
The module addresses most of the issues with respect to processing various possible formats of specifying the time. Only thing I found missing was what I mentioned above - when we give it a number without any format hints.
To overcome this, the user will have to check the input and add some default format hint.
I felt that adding this support makes the module more comprehensive.
Yeah I feel like a simple number should be parsed as plain seconds.
If we do
parse("10")
, it returnsNone
. Maybe the module should define (or have a setting) for a default time unit. That way we get a predictable output.