<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Lib/datetime.py, branch misc-acks-comment</title>
<subtitle>github.com: python/cpython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/'/>
<entry>
<title>bpo-38155: Add __all__ to datetime module (GH-16203)</title>
<updated>2019-09-19T13:34:41+00:00</updated>
<author>
<name>t k</name>
<email>tahia.khan@gmail.com</email>
</author>
<published>2019-09-19T13:34:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=96b1c59c71534db3f0f3799cd84e2006923a5098'/>
<id>96b1c59c71534db3f0f3799cd84e2006923a5098</id>
<content type='text'>
https://bugs.python.org/issue38155</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://bugs.python.org/issue38155</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-37642: Update acceptable offsets in timezone (GH-14878)</title>
<updated>2019-08-09T14:22:16+00:00</updated>
<author>
<name>Ngalim Siregar</name>
<email>ngalim.siregar@gmail.com</email>
</author>
<published>2019-08-09T14:22:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=92c7e30adf5c81a54d6e5e555a6bdfaa60157a0d'/>
<id>92c7e30adf5c81a54d6e5e555a6bdfaa60157a0d</id>
<content type='text'>
This fixes an inconsistency between the Python and C implementations of
the datetime module. The pure python version of the code was not
accepting offsets greater than 23:59 but less than 24:00. This is an
accidental legacy of the original implementation, which was put in place
before tzinfo allowed sub-minute time zone offsets.

GH-14878</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes an inconsistency between the Python and C implementations of
the datetime module. The pure python version of the code was not
accepting offsets greater than 23:59 but less than 24:00. This is an
accidental legacy of the original implementation, which was put in place
before tzinfo allowed sub-minute time zone offsets.

GH-14878</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-37685: Fixed comparisons of datetime.timedelta and datetime.timezone. (GH-14996)</title>
<updated>2019-08-04T09:38:46+00:00</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2019-08-04T09:38:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=17e52649c0e7e9389f1cc2444a53f059e24e6bca'/>
<id>17e52649c0e7e9389f1cc2444a53f059e24e6bca</id>
<content type='text'>
There was a discrepancy between the Python and C implementations.

Add singletons ALWAYS_EQ, LARGEST and SMALLEST in test.support
to test mixed type comparison.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There was a discrepancy between the Python and C implementations.

Add singletons ALWAYS_EQ, LARGEST and SMALLEST in test.support
to test mixed type comparison.
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-37579: Improve equality behavior for pure Python datetime and time (GH-14726)</title>
<updated>2019-07-13T13:22:21+00:00</updated>
<author>
<name>Xtreak</name>
<email>tir.karthi@gmail.com</email>
</author>
<published>2019-07-13T13:22:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=e6b46aafad3427463d6264a68824df4797e682f1'/>
<id>e6b46aafad3427463d6264a68824df4797e682f1</id>
<content type='text'>
Returns NotImplemented for timedelta and time in __eq__ for different types in Python implementation, which matches the C implementation.

This also adds tests to enforce that these objects will fall back to the right hand side's __eq__ and/or __ne__ implementation.

bpo-37579
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Returns NotImplemented for timedelta and time in __eq__ for different types in Python implementation, which matches the C implementation.

This also adds tests to enforce that these objects will fall back to the right hand side's __eq__ and/or __ne__ implementation.

bpo-37579
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-36004: Add date.fromisocalendar (GH-11888)</title>
<updated>2019-04-29T13:22:03+00:00</updated>
<author>
<name>Paul Ganssle</name>
<email>pganssle@users.noreply.github.com</email>
</author>
<published>2019-04-29T13:22:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=88c093705615c50c47fdd9ab976803f73de7e308'/>
<id>88c093705615c50c47fdd9ab976803f73de7e308</id>
<content type='text'>
This commit implements the first version of date.fromisocalendar, the
inverse function for date.isocalendar.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit implements the first version of date.fromisocalendar, the
inverse function for date.isocalendar.</pre>
</div>
</content>
</entry>
<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://git.baserock.org/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://git.baserock.org/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://git.baserock.org/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://git.baserock.org/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://git.baserock.org/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>
</feed>
