Skip to content

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

Open
nmlorg wants to merge 1 commit intostub42:masterfrom
nmlorg:master
Open

Expose the full zone.tab file as pytz.zone_tab.#29
nmlorg wants to merge 1 commit intostub42:masterfrom
nmlorg:master

Conversation

@nmlorg
Copy link

@nmlorg nmlorg commented Aug 1, 2019

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

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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant