case-insensitive timezone constructor

Asked by kyle hausmann on 2019-01-03

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

Thanks!

Question information

Language:
English Edit question
Status:
Solved
For:
pytz Edit question
Assignee:
No assignee Edit question
Solved by:
Stuart Bishop
Solved:
2019-01-07
Last query:
2019-01-07
Last reply:
2019-01-07
Best Stuart Bishop (stub) said : #1

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 https://github.com/stub42/pytz

kyle hausmann (khlaunching) said : #2

Thanks Stuart Bishop, that solved my question.