arrow-py / arrow

🏹 Better dates & times for Python
https://arrow.readthedocs.io
Apache License 2.0
8.71k stars 673 forks source link

Should arrow.get(None) work? #900

Closed systemcatch closed 3 years ago

systemcatch commented 3 years ago

As per the title should the following work?

>>> arrow.get(None)
<Arrow [2020-12-20T20:12:12.631217+00:00]>

https://github.com/arrow-py/arrow/blob/master/arrow/factory.py#L169

There could be an issue where someone unintentionally passes None in but gets no error. Realistically is this used?

nkitsaini commented 3 years ago

Never had any issue with this. But it seems to be too implicit.

systemcatch commented 3 years ago

I think it's a potential gotcha but as you say I've never been caught by it myself.

krisfremen commented 3 years ago

I would agree toward it not working.

Everything that in theory isn't an actual string or object that can be parsed into an Arrow, should raise an exception at least.

Armaxxx commented 3 years ago

Can I help with this issue raising an exception?

jadchaar commented 3 years ago

Go for it @Armaxxx!