Commit Graph

37297 Commits

Author SHA1 Message Date
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 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 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
Steve Dower f3291a8340 Issue #8232: Renamed WinFireFox to WinFirefox 2015-06-15 09:11:14 -07:00
Victor Stinner 138adb8d05 (Merge 3.4) Issue #15745: Rewrite os.utime() tests in test_os
* Don't use the timestamp of an existing file anymore, only use fixed
  timestamp
* Enhance the code checking the resolution of the filesystem timestamps.
* Check timestamps with a resolution of 1 microsecond instead of 1 millisecond
* When os.utime() uses the current system clock, tolerate a delta of 20 ms.
  Before some os.utime() tolerated a different of 10 seconds.
* Merge duplicated tests and simplify the code
2015-06-12 22:01:54 +02:00
Victor Stinner e12e7aa3fd Issue #15745: Rewrite os.utime() tests in test_os
* Don't use the timestamp of an existing file anymore, only use fixed
  timestamp
* Enhance the code checking the resolution of the filesystem timestamps.
* Check timestamps with a resolution of 1 microsecond instead of 1 millisecond
* When os.utime() uses the current system clock, tolerate a delta of 20 ms.
  Before some os.utime() tolerated a different of 10 seconds.
* Merge duplicated tests and simplify the code
2015-06-12 21:58:00 +02:00
Serhiy Storchaka fabdc827a5 Issue #24408: Added more tkinter.Font tests. 2015-06-09 07:21:00 +03:00
Serhiy Storchaka c0ed707b2f Issue #24408: Added more tkinter.Font tests. 2015-06-09 07:18:54 +03:00
Serhiy Storchaka 23e6109112 Issue #24299: Fixed test__locale on Solaris. 2015-06-08 18:50:18 +03:00
Serhiy Storchaka 07c002573a Issue #24299: Fixed test__locale on Solaris. 2015-06-08 18:48:33 +03:00
Serhiy Storchaka 4fafda731a Issue #24408: Fixed AttributeError in measure() and metrics() methods of
tkinter.Font.
2015-06-08 18:43:55 +03:00
Serhiy Storchaka 391af751f2 Issue #14373: Other attempt to fix threaded test for lru_cache(). 2015-06-08 12:44:18 +03:00
Serhiy Storchaka e7070f09bc Issue #14373: C implementation of functools.lru_cache() now can be used with
methods.
2015-06-08 11:19:24 +03:00
Serhiy Storchaka 77cb197aaa Issue #14373: Fixed threaded test for lru_cache(). Added new threaded test. 2015-06-08 11:14:31 +03:00
Steve Dower 93cfeb93ac Issue #8232: webbrowser support incomplete on Windows. Patch by Brandon Milam 2015-06-07 21:35:39 -07:00
Tal Einat 988df6a365 added matmul and imatmul to operator.__all__ 2015-06-07 19:21:01 +03:00
Yury Selivanov 94c2263005 Issue 24374: Plug refleak in set_coroutine_wrapper 2015-06-04 10:16:51 -04:00
Eric Snow 4fabf02633 Issue #24369: Defend against key-changes during iteration. 2015-06-04 00:09:56 -06:00
Eric Snow ac02ef373f Issue #24368: Support keyword arguments in OrderedDict methods. 2015-06-02 20:42:14 -06:00
Yury Selivanov aab3c4a211 Issue 24342: Let wrapper set by sys.set_coroutine_wrapper fail gracefully 2015-06-02 18:43:51 -04:00
Donald Stufft 231d90609b Merge update to pip/setuptools 2015-06-02 11:39:55 -04:00
Donald Stufft 96cf848a8b Upgrade pip to 7.0.3 and setuptools to 17.0 2015-06-02 11:39:31 -04:00
Donald Stufft 67872ba91a Merge the fix for #24267 2015-06-02 10:38:01 -04:00
Donald Stufft 71a8589ddc Closes #24267 - Does not check version on ensurepip uninstall
Ensure that the uninstall helper for Windows passes the proper
flags to pip to prevent it from checking PyPI if the pip that
we're currently attempting to uninstall is the latest verison.
2015-06-02 10:37:08 -04:00
Eric Snow b952ab43f2 Issue #24359: Check for changed OrderedDict size during iteration. 2015-06-01 23:35:13 -06:00
Eric Snow d171975609 Issue #24348: Drop superfluous increfs/decrefs. 2015-06-01 23:12:13 -06:00
Eric Snow a762af74b2 Issue #24347: Set KeyError if PyDict_GetItemWithError returns NULL. 2015-06-01 22:59:08 -06:00
Larry Hastings c72056a1ae Merge release engineering changes with 3.5 branch head. 2015-05-31 21:43:57 -07:00
Yury Selivanov e42cc38639 Issue 24017: Add a test for CoroWrapper and 'async def' coroutines 2015-05-31 21:44:05 -04:00
Yury Selivanov 6a0fab92f9 Issue 24017: Fix asyncio.CoroWrapper to support 'async def' coroutines 2015-05-31 21:37:23 -04:00
Yury Selivanov 70adad2a0e Issue 24017: Fix asyncio.CoroWrapper to support 'async def' coroutines 2015-05-31 21:37:09 -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 439c5fe3ae Issue 24004: Fix DeprecationWarning in a unittest 2015-05-31 11:28:35 -04:00
Serhiy Storchaka d4ea03c785 Issue #24284: The startswith and endswith methods of the str class no longer
return True when finding the empty string and the indexes are completely out
of range.
2015-05-31 09:15:51 +03:00
Yury Selivanov ad583a8e6d Issue 24004: Add a unittest for @asyncio.coroutine supporting Awaitables 2015-05-30 21:04:37 -04:00
Yury Selivanov 353f2299bf Issue 24004: Support Awaitables (pep 492) in @asyncio.coroutine decorator
(Merge 3.4)
2015-05-30 21:02:34 -04:00
Yury Selivanov a316085192 Issue 24004: Support Awaitables (pep 492) in @asyncio.coroutine decorator 2015-05-30 21:02:12 -04:00
Larry Hastings e8ff0caa72 Regenerated pydoc topic index in preparation for Python 3.5.0b2. 2015-05-30 16:58:27 -07:00
Yury Selivanov bf304fcb32 Issue #23934: Fix inspect.signature to fail correctly for builtin types.
Initial patch by James Powell.
2015-05-30 17:08:36 -04:00
Eric Snow 67fb92e8c6 Issue #16991: Do not return None from OrderedDict.__reversed__. 2015-05-30 11:43:36 -06:00
Serhiy Storchaka 1b560cbf85 Issue #5633: Fixed timeit when the statement is a string and the setup is not.
Refactored timeit.__init__ for unified handling of stmt and setup parameters.
2015-05-30 19:44:55 +03:00
Serhiy Storchaka f28fa66351 Issue #5633: Fixed timeit when the statement is a string and the setup is not. 2015-05-30 19:38:26 +03:00
Yury Selivanov 7aa5341164 Reverting my previous commit.
Something went horribly wrong when I was doing `hg rebase`.
2015-05-30 10:57:56 -04:00
Serhiy Storchaka f49c42324f Use test.support.start_threads() in threaded lru_cache tests. 2015-05-30 15:49:42 +03:00
Serhiy Storchaka bf2b3b72d3 Use test.support.start_threads() in threaded lru_cache tests. 2015-05-30 15:49:17 +03:00
Raymond Hettinger 4c97a62ae3 Issue #23509: Speed up Counter operators
(Based on patch by Serhiy Storchaka.)
2015-05-29 22:14:07 -07:00
Benjamin Peterson e16f427243 Merge 3.5 2015-05-30 00:02:25 -05:00
Benjamin Peterson 3d1151d2c0 use assert method in another place 2015-05-30 00:02:17 -05:00