Commit Graph

2440 Commits

Author SHA1 Message Date
Victor Stinner
6df29ada02 Issue #25150: Hide the private _Py_atomic_xxx symbols from the public
Python.h header to fix a compilation error with OpenMP. PyThreadState_GET()
becomes an alias to PyThreadState_Get() to avoid ABI incompatibilies.

It is important that the _PyThreadState_Current variable is always accessed
with the same implementation of pyatomic.h. Use the PyThreadState_Get()
function so extension modules will all reuse the same implementation.
2015-09-18 15:06:34 +02:00
Victor Stinner
9a8b177e60 Issue #25155: Add _PyTime_AsTimevalTime_t() function
On Windows, the tv_sec field of the timeval structure has the type C long,
whereas it has the type C time_t on all other platforms. A C long has a size of
32 bits (signed inter, 1 bit for the sign, 31 bits for the value) which is not
enough to store an Epoch timestamp after the year 2038.

Add the _PyTime_AsTimevalTime_t() function written for datetime.datetime.now():
convert a _PyTime_t timestamp to a (secs, us) tuple where secs type is time_t.
It allows to support dates after the year 2038 on Windows.

Enhance also _PyTime_AsTimeval_impl() to detect overflow on the number of
seconds when rounding the number of microseconds.
2015-09-18 13:36:17 +02:00
Larry Hastings
9c51f89cd6 Merge release engineering work from Python 3.5.0. 2015-09-13 15:43:21 +01:00
Larry Hastings
82c0c69011 Post-release updates for Python 3.5.0. 2015-09-13 15:36:07 +01:00
Larry Hastings
f92f6c8e56 Version bump for Python 3.5.0 final. 2015-09-12 17:28:39 +01:00
Larry Hastings
ded28e3863 Merge Python 3.5.0rc4 back to hg.python.org. 2015-09-09 06:52:38 -07:00
Larry Hastings
03728fac15 Post-release update for Python 3.5.0rc4. 2015-09-09 06:45:19 -07:00
Larry Hastings
1043f95b9b Version bump for Python 3.5.0rc4. 2015-09-08 23:58:10 -07:00
Larry Hastings
c8c47f55e6 Merge heads. 2015-09-07 05:16:38 -07:00
Larry Hastings
442c560bd8 Version bump for Python 3.5.0rc3. 2015-09-07 05:12:05 -07:00
Yury Selivanov
beaa5094a2 docs: Better comment for tp_as_async slot 2015-08-26 13:03:57 -04:00
Larry Hastings
a51812ae98 Post-release updates for Python 3.5.0rc2. 2015-08-25 13:30:58 -07:00
Larry Hastings
e6c6f69ac9 Version bump for Python 3.5.0rc2. 2015-08-24 20:31:53 -07:00
R David Murray
803502c56b #21167: Fix definition of NAN when ICC used without -fp-model strict.
Patch from Chris Hogan of Intel, reviewed by Mark Dickinson.
2015-08-15 18:33:45 -04:00
Larry Hastings
2ab6ddb19d Post-release bump for Python 3.5.0rc1. 2015-08-10 18:03:52 -07:00
Larry Hastings
71ea65feed Release bump for Python 3.5.0rc1. 2015-08-09 03:41:04 -07:00
Larry Hastings
3d1dc904f4 Post-release updates for Python 3.5.0b4. 2015-07-26 07:55:08 -07:00
Larry Hastings
164df4e51a Version bump for Python 3.5.0b4. 2015-07-25 14:22:13 -07:00
Larry Hastings
b34db6ad9b Post-release fixes for Python 3.5.0b3. 2015-07-05 10:26:00 -07:00
Larry Hastings
9626971c74 Version bump for Python 3.5.0b3 release. 2015-07-04 19:13:02 -07:00
Yury Selivanov
f488fb422a Issue #19235: Add new RecursionError exception. Patch by Georg Brandl. 2015-07-03 01:04:23 -04:00
Yury Selivanov
5376ba9630 Issue #24400: Introduce a distinct type for 'async def' coroutines.
Summary of changes:

1. Coroutines now have a distinct, separate from generators
   type at the C level: PyGen_Type, and a new typedef PyCoroObject.
   PyCoroObject shares the initial segment of struct layout with
   PyGenObject, making it possible to reuse existing generators
   machinery.  The new type is exposed as 'types.CoroutineType'.

   As a consequence of having a new type, CO_GENERATOR flag is
   no longer applied to coroutines.

2. Having a separate type for coroutines made it possible to add
   an __await__ method to the type.  Although it is not used by the
   interpreter (see details on that below), it makes coroutines
   naturally (without using __instancecheck__) conform to
   collections.abc.Coroutine and collections.abc.Awaitable ABCs.

   [The __instancecheck__ is still used for generator-based
   coroutines, as we don't want to add __await__ for generators.]

3. Add new opcode: GET_YIELD_FROM_ITER.  The opcode is needed to
   allow passing native coroutines to the YIELD_FROM opcode.

   Before this change, 'yield from o' expression was compiled to:

      (o)
      GET_ITER
      LOAD_CONST
      YIELD_FROM

   Now, we use GET_YIELD_FROM_ITER instead of GET_ITER.

   The reason for adding a new opcode is that GET_ITER is used
   in some contexts (such as 'for .. in' loops) where passing
   a coroutine object is invalid.

4. Add two new introspection functions to the inspec module:
   getcoroutinestate(c) and getcoroutinelocals(c).

5. inspect.iscoroutine(o) is updated to test if 'o' is a native
   coroutine object.  Before this commit it used abc.Coroutine,
   and it was requested to update inspect.isgenerator(o) to use
   abc.Generator; it was decided, however, that inspect functions
   should really be tailored for checking for native types.

6. sys.set_coroutine_wrapper(w) API is updated to work with only
   native coroutines.  Since types.coroutine decorator supports
   any type of callables now, it would be confusing that it does
   not work for all types of coroutines.

7. Exceptions logic in generators C implementation was updated
   to raise clearer messages for coroutines:

   Before: TypeError("generator raised StopIteration")
   After: TypeError("coroutine raised StopIteration")
2015-06-22 12:19:30 -04:00
Serhiy Storchaka
289dd19124 Added the const qualifier for char* argument of Py_EnterRecursiveCall(). 2015-06-21 16:27:09 +03:00
Serhiy Storchaka
5fa22fc088 Added the const qualifier for char* argument of Py_EnterRecursiveCall(). 2015-06-21 16:26:28 +03:00
Serhiy Storchaka
ccfdf0923a Issue #24436: Added const qualifiers for char* arguments of _PyTraceback_Add.
Patch by Michael Ensslin.
2015-06-21 16:00:33 +03:00