Commit Graph

18044 Commits

Author SHA1 Message Date
Benjamin Peterson
b5048d3938 merge 3.5 2015-06-27 15:46:31 -05:00
Benjamin Peterson
4801383c29 upgrade to Unicode 8.0.0 2015-06-27 15:45:56 -05:00
Berker Peksag
ae44292fe2 Issue #23684: Clarify the return value of the scheme attribute of ParseResult and SplitResult objects.
Patch by Martin Panter.
2015-06-25 23:39:53 +03:00
Berker Peksag
a7c781724f Issue #23684: Clarify the return value of the scheme attribute of ParseResult and SplitResult objects.
Patch by Martin Panter.
2015-06-25 23:39:26 +03:00
Berker Peksag
89584c97e4 Issue #23684: Clarify the return value of the scheme attribute of ParseResult and SplitResult objects.
Patch by Martin Panter.
2015-06-25 23:38:48 +03:00
Yury Selivanov
52c6d599f5 Merge 3.5 (issue #24509) 2015-06-25 13:50:38 -04:00
Yury Selivanov
e79f3557cc Merge 3.4 (issue #24509) 2015-06-25 13:50:21 -04:00
Yury Selivanov
1096f761b6 Issue #24509: Clarify Handle.cancel() and loop.call_* methods. 2015-06-25 13:49:52 -04:00
Yury Selivanov
e05c7702b2 Merge 3.5 2015-06-25 11:55:02 -04:00
Yury Selivanov
f76628fa5d Merge 3.4 2015-06-25 11:54:49 -04:00
Yury Selivanov
bb96134368 asyncio.docs: Use less confusing title 2015-06-25 11:54:34 -04:00
Yury Selivanov
b446a6c8af Merge 3.5 (Issue #24439) 2015-06-25 11:48:52 -04:00
Yury Selivanov
edb09c5c0b Issue #24439: Update tulip_coro.dia 2015-06-25 11:48:32 -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
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
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
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