Commit Graph

8805 Commits

Author SHA1 Message Date
Nick Coghlan d5cacbb1d9 PEP 489: Multi-phase extension module initialization
Known limitations of the current implementation:

- documentation changes are incomplete
- there's a reference leak I haven't tracked down yet

The leak is most visible by running:

  ./python -m test -R3:3 test_importlib

However, you can also see it by running:

  ./python -X showrefcount

Importing the array or _testmultiphase modules, and
then deleting them from both sys.modules and the local
namespace shows significant increases in the total
number of active references each cycle. By contrast,
with _testcapi (which continues to use single-phase
initialisation) the global refcounts stabilise after
a couple of cycles.
2015-05-23 22:24:10 +10:00
Steve Dower d9ef74e3dd Issue 24244: Prevents termination when an invalid format string is encountered on Windows. 2015-05-22 15:08:34 -07:00
Zachary Ware 7dc9dea778 Issue #20035: Reimplement tkinter._fix module as a C function.
The new private C function makes no permanent changes to the environment
and is #ifdef'd out on non-Windows platforms.
2015-05-22 11:36:53 -05:00
Serhiy Storchaka e79ec70801 Issue #24257: Fixed incorrect uses of PyObject_IsInstance().
Fixed segmentation fault in sqlite3.Row constructor with faked cursor type.
Fixed system error in the comparison of faked types.SimpleNamespace.
2015-05-22 11:13:20 +03:00
Serhiy Storchaka 08d230a540 Issue #24257: Fixed incorrect uses of PyObject_IsInstance().
Fixed segmentation fault in sqlite3.Row constructor with faked cursor type.
Fixed system error in the comparison of faked types.SimpleNamespace.
2015-05-22 11:02:49 +03:00
Raymond Hettinger 5cbd8331ff Issue #24221: Small optimizations for heapq.
Replaces the PyList_GET_ITEM and PyList_SET_ITEM macros with normal array
accesses.  Replace the siftup unpredicatable branch with arithmetic.
Replace the rc == -1 tests with rc < 0.  Gives nicer looking assembly
with both Clang and GCC-4.9.  Also gives a small performance both for both.
2015-05-22 00:41:57 -07:00
Serhiy Storchaka 548de2b210 Issue #22955: Fixed reference leak in attrgetter.repr(). 2015-05-21 14:19:20 +03:00
Antoine Pitrou 45d6156154 Issue #9858: Add missing method stubs to _io.RawIOBase. Patch by Laura Rupprecht. 2015-05-20 21:50:59 +02:00
Serhiy Storchaka 35ac5f8280 Issue #22955: attrgetter, itemgetter and methodcaller objects in the operator
module now support pickling.  Added readable and evaluable repr for these
objects.  Based on patch by Josh Rosenberg.
2015-05-20 18:29:18 +03:00
Serhiy Storchaka a2c145c2f3 Issue #24091: Fixed various crashes in corner cases in C implementation of
ElementTree.
2015-05-18 18:33:31 +03:00
Serhiy Storchaka 5bf3120e24 Issue #24091: Fixed various crashes in corner cases in C implementation of
ElementTree.
2015-05-18 18:29:33 +03:00
Zachary Ware c15ea4c812 Issue #23488: Fix a syntax error on big endian platforms.
Hopefully this will allow the PPC64 PowerLinux buildbot to finish a test run.
2015-05-17 23:46:22 -05:00
Benjamin Peterson de12b79cd6 allow test node after ** in calls (closes #24176) 2015-05-16 09:44:45 -04:00
Serhiy Storchaka 6b680cd6b2 Fixed compilation error in signalmodule.c (issue #20182). 2015-05-16 15:57:56 +03:00
Tal Einat c7027b7904 Issue #20182: converted the signal module to use Argument Clinic 2015-05-16 14:14:49 +03:00
Raymond Hettinger c784c6db60 Tighten-up code by eliminating an unnecessary variable. 2015-05-15 21:01:13 -07:00
Raymond Hettinger d69755d1a3 Minor code clean-up. 2015-05-15 17:53:52 -07:00
Zachary Ware 77772c0e7b Issue #20172: Update clinicizations to current clinic. 2015-05-13 10:58:35 -05:00
Serhiy Storchaka dce0405f03 Issue #23488: Random generator objects now consume 2x less memory on 64-bit. 2015-05-13 15:02:12 +03:00
Zachary Ware f2244eaf9e Issue #20172: Convert the _winapi module to Argument Clinic. 2015-05-13 01:22:54 -05:00
Raymond Hettinger 636488043b More timings suggest that 2500 is closer to the break-even point. 2015-05-12 21:40:50 -07:00
Serhiy Storchaka f0b5015edb Converted os._getfullpathname() and os._isdir() to Argument Clinic. 2015-05-13 00:52:39 +03:00
Serhiy Storchaka 48e47aaa28 Issue #22486: Added the math.gcd() function. The fractions.gcd() function now is
deprecated.  Based on patch by Mark Dickinson.
2015-05-13 00:19:51 +03:00
Berker Peksag ea6d5592f2 Issue #23796: peak and read1 methods of BufferedReader now raise ValueError
if they called on a closed object.

Patch by John Hergenroeder.
2015-05-12 17:13:56 +03:00
Berker Peksag d10d6ae2fa Issue #23796: peak and read1 methods of BufferedReader now raise ValueError
if they called on a closed object.

Patch by John Hergenroeder.
2015-05-12 17:01:05 +03:00
Serhiy Storchaka 1aa5e1d63e Fixed compilation on Windows for issue #20173. 2015-05-12 14:00:22 +03:00
Serhiy Storchaka 0c59ff6430 Issue #20173: Converted the _codecs module to Argument Clinic. 2015-05-12 13:15:57 +03:00
Raymond Hettinger b9db9e152f Defend against a mutation during comparison 2015-05-11 19:58:56 -07:00
Yury Selivanov 7544508f02 PEP 0492 -- Coroutines with async and await syntax. Issue #24017. 2015-05-11 22:57:16 -04:00
Raymond Hettinger 4e6bf4b3da merge 2015-05-11 19:59:21 -07:00
Raymond Hettinger 99bf9a2567 Minor code cleanups. 2015-05-11 19:25:32 -07:00
Raymond Hettinger a032e46df6 Minor stylistic clean-up. 2015-05-11 10:32:57 -07:00
Raymond Hettinger bc33e57d56 Issue #24155: Optimize heapify for better cache utililzation. 2015-05-11 10:19:03 -07:00
Benjamin Peterson dae2ef1cfa merge 3.4 2015-05-09 00:29:08 -04:00
Benjamin Peterson 65bcdd7195 ensure .keywords is always a dict 2015-05-09 00:25:18 -04:00
Benjamin Peterson 43e3d22fee merge 3.4 (#23042) 2015-05-08 21:32:36 -04:00
Benjamin Peterson 0171d7faa0 fix libffi compilation on FreeBSD (#23042)
Patch from Marc-Andre Lemburg.
2015-05-08 21:31:36 -04:00
Larry Hastings 3b12e957a7 Issue #20274: When calling a _sqlite.Connection, it now complains if passed
any keyword arguments.  Previously it silently ignored them.

Also: merge related change from 3.4, also reported on Issue #20274.
2015-05-08 07:45:10 -07:00
Larry Hastings 01b0883602 Issue #20274: Remove ignored and erroneous "kwargs" parameters from three
METH_VARARGS methods on _sqlite.Connection.
2015-05-08 07:37:49 -07:00
Larry Hastings 38337d1e15 Issue #24000: Improved Argument Clinic's mapping of converters to legacy
"format units".  Updated the documentation to match.
2015-05-07 23:30:09 -07:00
Serhiy Storchaka 8d0f620285 Use specialized functions intead of Py_BuildValue() in _tkinter. 2015-05-06 14:19:22 +03:00
Serhiy Storchaka 645058d11a Issue #23880: Tkinter's getint() and getdouble() now support Tcl_Obj.
Tkinter's getdouble() now supports any numbers (in particular int).
2015-05-06 14:00:04 +03:00
Serhiy Storchaka 008d88b462 Issue #24009: Got rid of using rare "y#" format unit in TextIOWrapper.tell().
Parsed value should be bytes, not general robuffer, this is required in other
places.
2015-05-06 09:53:07 +03:00
Benjamin Peterson 025e9ebd0a PEP 448: additional unpacking generalizations (closes #2292)
Patch by Neil Girdhar.
2015-05-05 20:16:41 -04:00
Larry Hastings dbfdc380df Issue #24001: Argument Clinic converters now use accept={type}
instead of types={'type'} to specify the types the converter accepts.
2015-05-04 06:59:46 -07:00
Serhiy Storchaka cb98556373 Issue #20159. Converted the _elementtree module to Argument Clinic. 2015-05-04 15:32:48 +03:00
Larry Hastings 2d0a69a456 Fix Windows build breakage from checkins on Issues #20148 and #20168. 2015-05-03 14:49:19 -07:00
Serhiy Storchaka 4b7b82f133 Issue #20179: Converted the _ssl module to Argument Clinic. 2015-05-03 16:14:08 +03:00
Serhiy Storchaka a860aeaf98 Issue #20148: Converted the _sre module to Argument Clinic. 2015-05-03 15:54:23 +03:00
Serhiy Storchaka 5abdf48430 Issue #20168: Converted the _tkinter module to Argument Clinic. 2015-05-03 15:49:47 +03:00