Arrow: Should arrow.get(None) work?

Created on 20 Dec 2020  路  5Comments  路  Source: arrow-py/arrow

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?

question for community

Most helpful comment

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.

All 5 comments

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

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

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.

Can I help with this issue raising an exception?

Go for it @Armaxxx!

Was this page helpful?
0 / 5 - 0 ratings