myusuf3 / delorean

Delorean: Time Travel Made Easy
http://delorean.rtfd.org/
MIT License
1.84k stars 128 forks source link

Breaking interface by returning pytz objects #79

Open iartarisi opened 8 years ago

iartarisi commented 8 years ago

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')

myusuf3 commented 8 years ago

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