Open dajose opened 6 years ago
I know that python2 doen't have datetime.timezone
.
Do you have any idea about python2 and 3 complexity without pytz?
ok, for python2 pytz is irreplaceable
I don't understand the question of complexity, what do you mean by that?
Ah, It means any idea to remove pytz. I agree with removing pytz dependency if we can.
oh, I found you guys use it in 2 places only and both times you use it to get utc
... As far as I've found on the web it is the same to use pytz.utc
to datetime.timezone.utc
, but I am not really sure about that.
Where I see the difficulty is supporting python2, because as you'd said there is no datetime.timezone
there :(
if we use datetime.timezone
.
then we can see error when use python2. python3 ok.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'timezone'
so we use pytz for python2.
I like the idea of dependency elimination, esp. if it's only included for the use of a single constant. Official PyMongo rolls its own utc
.
I want to integrate bson in a custom yocto image and I'm having troubles installing pytz dependency. I searched the repo and I found it is used here
I'm wondering if we could replace it with datetime.timezone.utc.