<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Lib/datetime.py, branch berkerpeksag-update-codeowners</title>
<subtitle>github.com: python/cpython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/'/>
<entry>
<title>bpo-36048: Use __index__() instead of __int__() for implicit conversion if available. (GH-11952)</title>
<updated>2019-02-25T15:57:58+00:00</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2019-02-25T15:57:58+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=6a44f6eef3d0958d88882347190b3e2d1222c2e9'/>
<id>6a44f6eef3d0958d88882347190b3e2d1222c2e9</id>
<content type='text'>
Deprecate using the __int__() method in implicit conversions of Python
numbers to C integers.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Deprecate using the __int__() method in implicit conversions of Python
numbers to C integers.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-32417: Make timedelta arithmetic respect subclasses (#10902)</title>
<updated>2019-02-04T19:42:04+00:00</updated>
<author>
<name>Paul Ganssle</name>
<email>pganssle@users.noreply.github.com</email>
</author>
<published>2019-02-04T19:42:04+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=89427cd0feae25bbc8693abdccfa6a8c81a2689c'/>
<id>89427cd0feae25bbc8693abdccfa6a8c81a2689c</id>
<content type='text'>
* Make timedelta return subclass types

Previously timedelta would always return the `date` and `datetime`
types, regardless of what it is added to. This makes it return
an object of the type it was added to.

* Add tests for timedelta arithmetic on subclasses

* Make pure python timedelta return subclass types

* Add test for fromtimestamp with tz argument

* Add tests for subclass behavior in now

* Add news entry.

Fixes:
bpo-32417
bpo-35364

* More descriptive variable names in tests

Addresses Victor's comments
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Make timedelta return subclass types

Previously timedelta would always return the `date` and `datetime`
types, regardless of what it is added to. This makes it return
an object of the type it was added to.

* Add tests for timedelta arithmetic on subclasses

* Make pure python timedelta return subclass types

* Add test for fromtimestamp with tz argument

* Add tests for subclass behavior in now

* Add news entry.

Fixes:
bpo-32417
bpo-35364

* More descriptive variable names in tests

Addresses Victor's comments
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-22005: Fixed unpickling instances of datetime classes pickled by Python 2. (GH-11017)</title>
<updated>2018-12-07T11:42:10+00:00</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2018-12-07T11:42:10+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=8452ca15f41061c8a6297d7956df22ab476d4df4'/>
<id>8452ca15f41061c8a6297d7956df22ab476d4df4</id>
<content type='text'>
encoding='latin1' should be used for successful decoding.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
encoding='latin1' should be used for successful decoding.
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-34454: Clean up datetime.fromisoformat surrogate handling (GH-8959)</title>
<updated>2018-10-22T16:32:52+00:00</updated>
<author>
<name>Paul Ganssle</name>
<email>pganssle@users.noreply.github.com</email>
</author>
<published>2018-10-22T16:32:52+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=3df85404d4bf420db3362eeae1345f2cad948a71'/>
<id>3df85404d4bf420db3362eeae1345f2cad948a71</id>
<content type='text'>
* Use _PyUnicode_Copy in sanitize_isoformat_str

* Use repr in fromisoformat error message

This reverses commit 67b74a98b2 per Serhiy Storchaka's suggestion:

     I suggested to use %R in the error message because including the raw
     string can be confusing in the case of empty string, or string
     containing trailing whitespaces, invisible or unprintable characters.

We agree that it is better to change both the C and pure Python versions
to use repr.

* Retain non-sanitized dtstr for error printing

This does not create an extra string, it just holds on to a reference to
the original input string for purposes of creating the error message.

* PEP 7 fixes to from_isoformat

* Separate handling of Unicode and other errors

In the initial implementation, errors other than encoding errors would
both raise an error indicating an invalid format, which would not be
true for errors like MemoryError.

* Drop needs_decref from _sanitize_isoformat_str

Instead _sanitize_isoformat_str returns a new reference, even to the
original string.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Use _PyUnicode_Copy in sanitize_isoformat_str

* Use repr in fromisoformat error message

This reverses commit 67b74a98b2 per Serhiy Storchaka's suggestion:

     I suggested to use %R in the error message because including the raw
     string can be confusing in the case of empty string, or string
     containing trailing whitespaces, invisible or unprintable characters.

We agree that it is better to change both the C and pure Python versions
to use repr.

* Retain non-sanitized dtstr for error printing

This does not create an extra string, it just holds on to a reference to
the original input string for purposes of creating the error message.

* PEP 7 fixes to from_isoformat

* Separate handling of Unicode and other errors

In the initial implementation, errors other than encoding errors would
both raise an error indicating an invalid format, which would not be
true for errors like MemoryError.

* Drop needs_decref from _sanitize_isoformat_str

Instead _sanitize_isoformat_str returns a new reference, even to the
original string.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-29097: Forego fold detection on windows for low timestamp values (GH-2385)</title>
<updated>2018-07-25T16:54:58+00:00</updated>
<author>
<name>Ammar Askar</name>
<email>ammar_askar@hotmail.com</email>
</author>
<published>2018-07-25T16:54:58+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=96d1e69a12ed8ab80203277e1abdaf573457a964'/>
<id>96d1e69a12ed8ab80203277e1abdaf573457a964</id>
<content type='text'>
On Windows, passing a negative value to local results in an OSError because localtime_s on Windows does not support negative timestamps. Unfortunately this means that fold detection for timestamps between 0 and max_fold_seconds will result in this OSError since we subtract max_fold_seconds from the timestamp to detect a fold. However, since we know there haven't been any folds in the interval [0, max_fold_seconds) in any timezone, we can hackily just forego fold detection for this time range on Windows.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On Windows, passing a negative value to local results in an OSError because localtime_s on Windows does not support negative timestamps. Unfortunately this means that fold detection for timestamps between 0 and max_fold_seconds will result in this OSError since we subtract max_fold_seconds from the timestamp to detect a fold. However, since we know there haven't been any folds in the interval [0, max_fold_seconds) in any timezone, we can hackily just forego fold detection for this time range on Windows.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-33812: Corrected astimezone for naive datetimes. (GH-7578)</title>
<updated>2018-06-10T21:02:58+00:00</updated>
<author>
<name>Alexander Belopolsky</name>
<email>abalkin@users.noreply.github.com</email>
</author>
<published>2018-06-10T21:02:58+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=877b23202b7e7d4f57b58504fd0eb886e8c0b377'/>
<id>877b23202b7e7d4f57b58504fd0eb886e8c0b377</id>
<content type='text'>
A datetime object d is aware if d.tzinfo is not None and
d.tzinfo.utcoffset(d) does  not return None. If d.tzinfo is None,
or if d.tzinfo is not None but d.tzinfo.utcoffset(d) returns None,
 d is naive.

This commit ensures that instances with non-None d.tzinfo, but
d.tzinfo.utcoffset(d) returning None are treated as naive.

In addition, C acceleration code will raise TypeError if
d.tzinfo.utcoffset(d) returns an object with the type other than
timedelta.

* Updated the documentation.

Assume that the term "naive" is defined elsewhere and remove the
not entirely correct clarification.  Thanks, Tim.

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A datetime object d is aware if d.tzinfo is not None and
d.tzinfo.utcoffset(d) does  not return None. If d.tzinfo is None,
or if d.tzinfo is not None but d.tzinfo.utcoffset(d) returns None,
 d is naive.

This commit ensures that instances with non-None d.tzinfo, but
d.tzinfo.utcoffset(d) returning None are treated as naive.

In addition, C acceleration code will raise TypeError if
d.tzinfo.utcoffset(d) returns an object with the type other than
timedelta.

* Updated the documentation.

Assume that the term "naive" is defined elsewhere and remove the
not entirely correct clarification.  Thanks, Tim.

</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-33810 Remove unused code from datetime.py. (GH-7549)</title>
<updated>2018-06-08T23:22:33+00:00</updated>
<author>
<name>Alexander Belopolsky</name>
<email>abalkin@users.noreply.github.com</email>
</author>
<published>2018-06-08T23:22:33+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=bcb032e4acdebc043a7659a06e6037fe71020860'/>
<id>bcb032e4acdebc043a7659a06e6037fe71020860</id>
<content type='text'>
Since implementation of bpo-25283, the objects returned by time.localtime
always have tm_zone and tm_gmtoff attributes.  Remove code that
anticipates their absence.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since implementation of bpo-25283, the objects returned by time.localtime
always have tm_zone and tm_gmtoff attributes.  Remove code that
anticipates their absence.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-15873: Implement [date][time].fromisoformat (#4699)</title>
<updated>2017-12-21T05:33:49+00:00</updated>
<author>
<name>Paul Ganssle</name>
<email>pganssle@users.noreply.github.com</email>
</author>
<published>2017-12-21T05:33:49+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=09dc2f508c8513e0466a759cc27a09108c1e55c2'/>
<id>09dc2f508c8513e0466a759cc27a09108c1e55c2</id>
<content type='text'>
Closes bpo-15873.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes bpo-15873.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-31222: Make (datetime|date|time).replace return subclass type in Pure Python (#4176)</title>
<updated>2017-11-09T21:34:29+00:00</updated>
<author>
<name>Paul Ganssle</name>
<email>pganssle@users.noreply.github.com</email>
</author>
<published>2017-11-09T21:34:29+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=191e993365ac3206f46132dcf46236471ec54bfa'/>
<id>191e993365ac3206f46132dcf46236471ec54bfa</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Closes issue bpo-5288: Allow tzinfo objects with sub-minute offsets. (#2896)</title>
<updated>2017-07-31T14:26:50+00:00</updated>
<author>
<name>Alexander Belopolsky</name>
<email>abalkin@users.noreply.github.com</email>
</author>
<published>2017-07-31T14:26:50+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=018d353c1c8c87767d2335cd884017c2ce12e045'/>
<id>018d353c1c8c87767d2335cd884017c2ce12e045</id>
<content type='text'>
* Closes issue bpo-5288: Allow tzinfo objects with sub-minute offsets.

* bpo-5288: Implemented %z formatting of sub-minute offsets.

* bpo-5288: Removed mentions of the whole minute limitation on TZ offsets.

* bpo-5288: Removed one more mention of the whole minute limitation.

Thanks @csabella!

* Fix a formatting error in the docs

* Addressed review comments.

Thanks, @haypo.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Closes issue bpo-5288: Allow tzinfo objects with sub-minute offsets.

* bpo-5288: Implemented %z formatting of sub-minute offsets.

* bpo-5288: Removed mentions of the whole minute limitation on TZ offsets.

* bpo-5288: Removed one more mention of the whole minute limitation.

Thanks @csabella!

* Fix a formatting error in the docs

* Addressed review comments.

Thanks, @haypo.
</pre>
</div>
</content>
</entry>
</feed>
