90074 Commits

Author SHA1 Message Date
Yury Selivanov
2cb6b7a7ff Merge 3.5 (issue #24325 & #24400) 2015-06-24 12:51:55 -04:00
Yury Selivanov
f847f1fba7 Issue #24400, #24325: More tests for types._GeneratorWrapper
Also, make 'wrapped' and 'isgen' private.
2015-06-24 12:49:28 -04:00
Yury Selivanov
ff9284bcb7 Merge 3.5 (Issue #24325, #24400) 2015-06-24 11:45:21 -04:00
Yury Selivanov
00e3372358 Issue #24325, #24400: Add more unittests for types.coroutine; tweak wrapper implementation. 2015-06-24 11:44:51 -04:00
Yury Selivanov
b257b7993c Merge 3.5 (issue #24439) 2015-06-24 11:04:39 -04:00
Yury Selivanov
66f8828bfc Issue #24439: Improve PEP 492 related docs.
Patch by Martin Panter.
2015-06-24 11:04:15 -04:00
Yury Selivanov
0ebde5b893 Merge 3.5 2015-06-24 10:55:33 -04:00
Yury Selivanov
fcba97242b Issue #24495, #24400: Test asyncio.Task.repr in debug mode 2015-06-24 10:55:12 -04:00
Yury Selivanov
57ed4181fe Fix asyncio unittests in debug mode (Merge 3.5) 2015-06-24 10:48:20 -04:00
Yury Selivanov
5ac716251f Fix asyncio unittests in debug mode 2015-06-24 10:47:44 -04:00
Yury Selivanov
339d5e7d85 Fix asyncio unittests in debug mode 2015-06-24 10:45:44 -04:00
Yury Selivanov
db422576a7 Issue #24400: Fix CoroWrapper for 'async def' coroutines 2015-06-24 10:32:41 -04:00
Yury Selivanov
8f1c99321b Issue #24400: Fix CoroWrapper for 'async def' coroutines 2015-06-24 10:32:22 -04:00
Yury Selivanov
29a602a140 Issue #24400: Fix CoroWrapper for 'async def' coroutines 2015-06-24 10:30:14 -04:00
Yury Selivanov
b64b42852a Merge 3.5 2015-06-24 09:42:08 -04:00
Yury Selivanov
3bdbcedfd9 Merge 3.4 2015-06-24 09:41:56 -04:00
Yury Selivanov
dfbd27f0be asyncio: Merge changes from issue #24400. 2015-06-24 09:41:35 -04:00
Raymond Hettinger
38bb95e49d Minor code cleanup. 2015-06-24 01:22:19 -07:00
Steve Dower
049030b06a Closes #24244: Removes invalid test from test_time 2015-06-23 20:48:52 -07:00
Steve Dower
7aec764d73 Closes #24244: Removes invalid test from test_time 2015-06-23 20:48:32 -07:00
Yury Selivanov
d396d53bc7 Merge 3.5 2015-06-23 15:10:21 -04:00
Yury Selivanov
27947d5d5c docs.whatsnew: Update ref to tp_as_async 2015-06-23 15:09:58 -04:00
Yury Selivanov
ebbd83e70d Merge 3.5 2015-06-23 11:46:26 -04:00
Yury Selivanov
bce294b993 docs.capi: Fix tp_as_async doc 2015-06-23 11:46:09 -04:00
Antoine Pitrou
d6362db83d Issue #24489: ensure a previously set C errno doesn't disturb cmath.polar(). 2015-06-23 14:39:57 +02:00
Antoine Pitrou
a72f0cdaea Issue #24489: ensure a previously set C errno doesn't disturb cmath.polar(). 2015-06-23 14:38:13 +02:00
Antoine Pitrou
6bc217dd3d Issue #24489: ensure a previously set C errno doesn't disturb cmath.polar(). 2015-06-23 14:31:11 +02:00
Yury Selivanov
6edc2f7549 Issue #24400: Merge 3.5 2015-06-22 12:31:24 -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
Dingyuan Wang
e411b6629f Issue #20387: Restore retention of indentation during untokenize. 2015-06-22 10:01:12 +08:00
Jason R. Coombs
b6d1cdda8e Issue #20387: Correct test to properly capture expectation. 2015-06-25 22:42:24 -04:00
Raymond Hettinger
7e3592dca6 Harmonize the bottom of the outer loop with its entry point
giving a small simplification.  Timings show that hash
pre-check seems only benefit the inner-loop (the linear probes).
2015-06-21 10:47:20 -07:00
Serhiy Storchaka
2e2f374098 Fixed documentation of functions with const char* arguments. 2015-06-21 17:12:40 +03:00
Serhiy Storchaka
cd881b850c Fixed documentation of functions with const char* arguments. 2015-06-21 17:12:16 +03:00
Serhiy Storchaka
03863d2b29 Fixed documentation of functions with const char* arguments. 2015-06-21 17:11:21 +03:00
Serhiy Storchaka
dcbff7d4e1 Added the const qualifier for char* argument of Py_EnterRecursiveCall(). 2015-06-21 16:27:36 +03: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
86621ae19b Issue #24436: Added const qualifiers for char* arguments of _PyTraceback_Add.
Patch by Michael Ensslin.
2015-06-21 16:00:58 +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
Serhiy Storchaka
73c95f1949 Issue #24436: Added const qualifiers for char* arguments of _PyTraceback_Add.
Patch by Michael Ensslin.
2015-06-21 15:59:46 +03:00
Serhiy Storchaka
1a2d134e31 Issue #24408: Fixed test for tkinter.Font on OS X.
Based on patch by Martin Panter.
2015-06-21 14:43:15 +03:00
Serhiy Storchaka
ac803cd2f3 Issue #24408: Fixed test for tkinter.Font on OS X.
Based on patch by Martin Panter.
2015-06-21 14:42:57 +03:00
Serhiy Storchaka
753a1dfcc2 Issue #24408: Fixed test for tkinter.Font on OS X.
Based on patch by Martin Panter.
2015-06-21 14:41:44 +03:00
Serhiy Storchaka
66dc4648fc Issue #24426: Fast searching optimization in regular expressions now works
for patterns that starts with capturing groups.  Fast searching optimization
now can't be disabled at compile time.
2015-06-21 14:06:55 +03:00
Raymond Hettinger
6ee588f14e Restore quick exit (no freeslot check) for common case (found null on first probe). 2015-06-20 21:39:51 -07:00
Jason R. Coombs
5713b3c5bf Issue #20387: Add test capturing failure to roundtrip indented code in tokenize module. 2015-06-20 19:52:22 -04:00
Jason R. Coombs
7cf36387e4 Remove unused import and remove doctest-only import into doctests. 2015-06-20 19:13:50 -04:00
Steve Dower
81fdd0b868 Issue 24476: Statically links vcruntime140.dll and removes it from the installer 2015-06-19 13:08:58 -07:00
Steve Dower
6d58f8dc52 Issue 24476: Statically links vcruntime140.dll and removes it from the installer 2015-06-19 10:49:04 -07:00