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

Thanks!

Question information

Language:
English Edit question
Status:
Solved
For:
pytz Edit question
Assignee:
No assignee Edit question
Solved by:
Stuart Bishop
Solved:
Last query:
Last reply:
Revision history for this message
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

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

Thanks Stuart Bishop, that solved my question.

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