timezone comparison bug

Bug #1853347 reported by Ignacio Mackenney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pytz
New
Undecided
Unassigned

Bug Description

Hi! a timezone constructed by pytz does not compare equal to the timezone obtained from a datetime localized by the timezone first mentioned.

An example:

(executed 2019-11-20 15:21:00)

---

from datetime import datetime
import pytz

tzcl = pytz.timezone('America/Santiago')
now = datetime.now()

now = tzcl.localize(now)

print(now.tzinfo == tzcl)
# False, expected True

print(tzcl.__repr__())
# <DstTzInfo 'America/Santiago' LMT-1 day, 19:17:00 STD>

print(now.tzinfo.__repr__())
# <DstTzInfo 'America/Santiago' -03-1 day, 21:00:00 DST>"

description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.