delorean icon indicating copy to clipboard operation
delorean copied to clipboard

Breaking interface by returning pytz objects

Open iartarisi opened this issue 9 years ago • 1 comments

Trying to parse a string and get its timezone returns a pytz object.

>>> type(delorean.parse('2016-02-10T14:32:44.773558').timezone)
<class 'pytz.UTC'>

I think Delorean shouldn't expose its implementation by returning objects from its dependencies like that. Also think I shouldn't have to import pytz in order to compare it against the Delorean object.

I'd be fine with just being able to do from delorean import utc or even from delorean import timezone; utc = timezone('UTC')

iartarisi avatar Feb 10 '16 16:02 iartarisi

This is a good point, let me see what we can do here. @mlew thoughts?

myusuf3 avatar Feb 16 '16 06:02 myusuf3