case-insensitive timezone constructor

Asked by kyle hausmann

Hi! I'm wondering if you're open to allowing `pytz.timezone(zone)` to accept zone arguments which match except for case. I often type eg `pytz.timezone('us/eastern')` and get bit by the mis-capitalization.

There may be principled reasons for only allowing case-sensitive arguments; I'd love to hear about them if so.

If not, I think it'd be pretty straightforward to implement. I have a small PR which does this (though if you allow outside contributions, I regret that I did not find guidelines for contributing).


Question information

English Edit question
pytz Edit question
No assignee Edit question
Solved by:
Stuart Bishop
Last query:
Last reply:
Revision history for this message
Best Stuart Bishop (stub) said :

This seems fine, and should not present any backwards compatibility issues. The strings made available by pytz (eg. pytz.all_timezones) need to keep the existing capitalization.

Proposals are accepted either here at Launchpad or via github at

Revision history for this message
kyle hausmann (khlaunching) said :

Thanks Stuart Bishop, that solved my question.

Revision history for this message
kyle hausmann (khlaunching) said :