Commit graph

6977 commits

Author SHA1 Message Date
Ned Deily
f1ce6deb41 Issue #24330: Update IDLE doc and help to note "Configure IDLE" difference
on OS X.  Original patch by André Freitas.
2015-07-04 15:05:07 -07:00
R David Murray
ac4f550bfc Merge: #24584: replace dead link with pointer to archive.org. 2015-07-04 15:45:41 -04:00
R David Murray
a1005ed1aa #24584: replace dead link with pointer to archive.org. 2015-07-04 15:44:14 -04:00
Yury Selivanov
fdbeb2b4b6 Issue #24400: Resurrect inspect.isawaitable()
collections.abc.Awaitable and collections.abc.Coroutine no longer
use __instancecheck__ hook to detect generator-based coroutines.

inspect.isawaitable() can be used to detect generator-based coroutines
and to distinguish them from regular generator objects.
2015-07-03 13:11:35 -04:00
Yury Selivanov
f488fb422a Issue #19235: Add new RecursionError exception. Patch by Georg Brandl. 2015-07-03 01:04:23 -04:00
Yury Selivanov
e13f8f3cab Issue #24450: Add gi_yieldfrom to generators; cr_await to coroutines.
Patch by Benno Leslie and Yury Selivanov.
2015-07-03 00:23:30 -04:00
Yury Selivanov
cc1d0287b5 Issue #24400: Mention that __instancecheck__ is used in abc.Awaitable and Coroutine 2015-07-01 12:49:00 -04:00
Yury Selivanov
04356e1f6f Issue #24487: Rename async() -> ensure_future() in asyncio docs.
Patch by Martin Panter.
2015-06-30 22:13:22 -04:00
Yury Selivanov
59a3b6764c Issue #24541: Drop test_inspect.test_eightteen unittest; update docs
Suggested by Martin Panter.
2015-06-30 22:06:42 -04:00
Yury Selivanov
a74b5e59af Issue #24400: Remove inspect.isawaitable().
isawaitable() was added before collections.abc.Awaitable; now,
with Awaitable, it is no longer needed (we don't have ishashable()
or isiterable() methods in the inspect module either).
2015-06-30 18:19:01 -04:00
Benjamin Peterson
4801383c29 upgrade to Unicode 8.0.0 2015-06-27 15:45:56 -05: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
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
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
edb09c5c0b Issue #24439: Update tulip_coro.dia 2015-06-25 11:48:32 -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
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
Senthil Kumaran
b4760efbad Back porting changeset db302b88fdb6 to 3.4 branch, which fixed multiple documentation typos.
Related Issues:

#issue21528
#issue24453
2015-06-14 17:35:37 -07:00
Raymond Hettinger
1c90670bc2 Issue #24453: Fix doubled word. 2015-06-14 16:08:06 -07:00
Terry Jan Reedy
8322b06945 Merge with 3.4 2015-06-12 16:47:58 -04:00
Terry Jan Reedy
6ac5cc15ce whitespace 2015-06-12 16:47:44 -04:00
Terry Jan Reedy
815f1a9128 Merge 3.4 2015-06-12 16:44:59 -04:00
Terry Jan Reedy
fe63c9a298 Issue #24406: Add sentences on dict comparisons, similar to those for Sequence
and set comparisions.  Patch by Gareth Rees.
2015-06-12 16:38:57 -04:00
Barry Warsaw
9380acbbf7 - Issue #24351: Clarify what is meant by "identifier" in the context of
string.Template instances.
2015-06-09 14:22:44 -04:00
Barry Warsaw
17d5f47423 - Issue #24351: Clarify what is meant by "identifier" in the context of
string.Template instances.
2015-06-09 14:20:31 -04:00
Benjamin Peterson
277b975260 merge 3.4 2015-06-05 21:03:46 -05:00
Benjamin Peterson
d9ede872cd that this is "for Python" is obvious 2015-06-05 21:03:08 -05:00
Berker Peksag
ab2f966f79 Issue #23659: Document **fmtparams in csv.register_dialect docstring.
Initial patch by Brandon Milam.
2015-06-05 15:18:17 +03:00
Berker Peksag
12b50ce4cb Issue #23659: Document **fmtparams in csv.register_dialect docstring.
Initial patch by Brandon Milam.
2015-06-05 15:17:51 +03:00
Berker Peksag
a5f62edbe3 Issue #24148: Fix incorrect Stats.sort_stats() example.
"cum" is not a valid argument.

Patch by Brandon Milam.
2015-06-05 14:48:55 +03:00
Berker Peksag
25587742f6 Issue #24148: Fix incorrect Stats.sort_stats() example.
"cum" is not a valid argument.

Patch by Brandon Milam.
2015-06-05 14:48:29 +03:00
Yury Selivanov
4180e43c12 Docs: Fix typo 2015-06-04 11:10:24 -04:00
Yury Selivanov
aab3c4a211 Issue 24342: Let wrapper set by sys.set_coroutine_wrapper fail gracefully 2015-06-02 18:43:51 -04:00
Ned Deily
fa1b47cc5a Issue #24357: merge from 3.4 2015-06-01 21:20:46 -07:00
Ned Deily
11cf4f6498 Issue #24357: use example.org instead 2015-06-01 21:19:30 -07:00
Ned Deily
03c28facd2 Issue #24357: merge from 3.4 2015-06-01 19:38:25 -07:00
Ned Deily
834f029c74 Issue #24357: fix real typo 2015-06-01 19:37:40 -07:00
Ned Deily
36a6a6bb3c Issue #24357: merge from 3.4 2015-06-01 19:20:31 -07:00
Ned Deily
9e2dc3f0b1 Issue #24357: fix typo 2015-06-01 19:17:44 -07:00
Ned Deily
3e4f976965 Issue #24357: merge from 3.4 2015-06-01 18:55:45 -07:00
Ned Deily
1b79e2d7ee Issue #24357: Change host in socket.getaddrinfo example to one that
does support IPv6 and IPv4; www.python.org currently does not.
2015-06-01 18:52:48 -07:00
Yury Selivanov
d4cbbebe2d Issue 24180: Document sys.(set|get)_coroutine_wrapper 2015-05-31 17:13:08 -04:00
Tal Einat
d5519ed7f4 Issue #19543: Implementation of isclose as per PEP 485
For details, see:
PEP 0485 -- A Function for testing approximate equality

Functions added: math.isclose() and cmath.isclose().

Original code by Chris Barker. Patch by Tal Einat.
2015-05-31 22:05:00 +03:00
Yury Selivanov
582b8c7629 Issue 22357: Merge from 3.4 2015-05-30 13:54:36 -04:00
Yury Selivanov
0339568753 Issue 22357: Document __qualname__ in inspect.rst 2015-05-30 13:53:49 -04:00
Yury Selivanov
56fc614025 Issue 24315: Make collections.abc.Coroutine derived from Awaitable 2015-05-29 09:01:29 -04:00
Benjamin Peterson
264be6f48f remove STORE_MAP, since it's unused 2015-05-28 14:40:08 -05:00