A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-April/111038.html below:

Refined time test in test_logging.

[Python-Dev] [Python-checkins] cpython: Refined time test in test_logging. [Python-Dev] [Python-checkins] cpython: Refined time test in test_logging.Éric Araujo merwok at netwok.org
Thu Apr 28 16:22:46 CEST 2011
Hi,

> http://hg.python.org/cpython/rev/5185e1d91f3d
> user:        Vinay Sajip <vinay_sajip at yahoo.co.uk>
> summary:
>   Refined time test in test_logging.

> +ZERO = datetime.timedelta(0)
> +
> +class UTC(datetime.tzinfo):
> +    def utcoffset(self, dt):
> +        return ZERO
> +
> +    dst = utcoffset
> +
> +    def tzname(self, dt):
> +        return 'UTC'
> +
> +utc = UTC()

Any reason not to use datetime.datetime.utc here?

Regards
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4