Skip to content

Expose pytz.UTC as an instance as opposed to as a class #723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 30, 2016

Conversation

rowillia
Copy link
Contributor

pytz shadows UTC after declaring it with a singleton:
https://github.com/newvem/pytz/blob/master/pytz/__init__.py#L135

This fixes #710

@@ -11,7 +11,7 @@ country_timezones = ... # type: Dict
country_names = ... # type: Dict


class UTC(dt.tzinfo):
class __UTC(dt.tzinfo):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not super keen on the __ prefix, given its conventional meaning. Maybe just name the class something longer with a single _, e.g. _UTCclass?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Will fix.

@ambv ambv merged commit 0391e72 into python:master Nov 30, 2016
@ambv
Copy link
Contributor

ambv commented Nov 30, 2016

🍰

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.

py2 pytz.UTC issue
3 participants