pytz icon indicating copy to clipboard operation
pytz copied to clipboard

Expose the full zone.tab file as pytz.zone_tab.

Open nmlorg opened this issue 5 years ago • 0 comments

In Python 2.6+, every entry in pytz.zone_tab is a named tuple with fields code, coordinates, zone, and comment, as in:

>>> [row for row in pytz.zone_tab if row.zone == 'America/Los_Angeles'][0].comment
'Pacific'

In all versions, pytz.zone_tab's entries are iterable as a set of values in that order:

>>> code, coordinates, zone, comment = pytz.zone_tab[399]
>>> zone, comment
(u'America/Los_Angeles', u'Pacific')

See https://bugs.launchpad.net/pytz/+bug/1324972 (and nmlorg/metabot#52).

nmlorg avatar Aug 01 '19 19:08 nmlorg