Commit Graph

98808 Commits

Author SHA1 Message Date
Serhiy Storchaka c7611362b4 Issue #27867: Silenced may-be-used-uninitialized warnings after
using PySlice_GetIndicesEx() in debug builds.
2017-02-04 11:04:00 +02:00
Berker Peksag 09f939d2c4 Issue #29198: Merge from 3.6 2017-02-04 09:35:10 +03:00
Berker Peksag 5a001eea5b Issue #29198: Merge from 3.5 2017-02-04 09:34:48 +03:00
Berker Peksag 5702fb7b4d Issue #29198: Fix indentation and markup in typing.rst
Patch by Jelle Zijlstra.
2017-02-04 09:34:16 +03:00
Berker Peksag b1d3f661d7 Issue #29198: Merge from 3.6 2017-02-04 09:19:04 +03:00
Berker Peksag 14169b2a89 Issue #29198: Merge from 3.5 2017-02-04 09:18:42 +03:00
Berker Peksag 38962a6fe2 Issue #29198: Document typing.AsyncGenerator
Patch by Jelle Zijlstra.
2017-02-04 09:18:11 +03:00
Serhiy Storchaka 19d2597ed5 Issue #29311: Regenerate Argument Clinic. 2017-02-04 08:05:07 +02:00
Xiang Zhang bbd256984d null merge 2017-02-03 11:08:45 +08:00
INADA Naoki 5566bbb8d5 Issue #29263: LOAD_METHOD support for C methods
Calling builtin method is at most 10% faster.
2017-02-03 07:43:03 +09:00
Vinay Sajip 144fff8b90 Closes #29213: Merged fix from 3.6. 2017-02-02 19:33:43 +00:00
Vinay Sajip 3746619b84 Fixes #29213: merged fix from 3.5. 2017-02-02 19:26:48 +00:00
Vinay Sajip db38b6c9a9 Fixes #29213: regularised EOLs of venv scripts. 2017-02-02 19:25:24 +00:00
Vinay Sajip 7601d780a7 Closes #24875: Merged fix from 3.6. 2017-02-02 19:17:51 +00:00
Vinay Sajip 993f535ae9 Fixes #24875: Merged fix from 3.5. 2017-02-02 19:17:02 +00:00
Vinay Sajip db6322cb8a Fixes #24875: pip can now be installed in a venv with --system-site-packages. 2017-02-02 19:05:19 +00:00
Raymond Hettinger e1af6964b4 Remove unnecessary variables.
* so->used never gets changed during a resize
* so->filled only changes when dummies are present and being eliminated
2017-02-02 08:24:48 -08:00
Serhiy Storchaka 196a7bc1ea Issue #29421: Make int.to_bytes() and int.from_bytes() slightly faster
(10-20% for small integers).
2017-02-02 16:54:45 +02:00
Victor Stinner c0f59ad145 Rename struct.unpack() 2nd parameter to "buffer"
Issue #29300: Rename struct.unpack() second parameter from "inputstr" to
"buffer", and use the Py_buffer type.

Fix also unit tests on struct.unpack() which passed a Unicode string instead of
a bytes string as struct.unpack() second parameter. The purpose of
test_trailing_counter() is to test invalid format strings, not to test the
buffer parameter.
2017-02-02 14:24:16 +01:00
Victor Stinner a0e454b69d Null merge 3.6 2017-02-02 14:19:26 +01:00
Victor Stinner 64e91275e3 Merge 3.5 2017-02-02 14:18:43 +01:00
Victor Stinner a5917d1d15 Issue #29300: test_struct tests unpack_from() with keywords
Add an unit test on the _struct.Struct.unpack_from() method to test passing
arguments as keywords.
2017-02-02 14:18:18 +01:00
Victor Stinner 3f2d10132d Issue #29300: Convert _struct module to Argument Clinic
* The struct module now requires contiguous buffers.
* Convert most functions and methods of the _struct module to Argument Clinic
* Use "Py_buffer" type for the "buffer" argument. Argument Clinic is
  responsible to create and release the Py_buffer object.
* Use "PyStructObject *" type for self to avoid explicit conversions.
* Add an unit test on the _struct.Struct.unpack_from() method to test passing
  arguments as keywords.
* Rephrase docstrings.
* Rename "fmt" argument to "format" in docstrings and the documentation.

As a side effect, functions and methods which used METH_VARARGS calling
convention like struct.pack() now use the METH_FASTCALL calling convention
which avoids the creation of temporary tuple to pass positional arguments and
so is faster. For example, struct.pack("i", 1) becomes 1.56x faster (-36%)::

    $ ./python -m perf timeit \
        -s 'import struct; pack=struct.pack' 'pack("i", 1)' \
        --compare-to=../default-ref/python
    Median +- std dev: 119 ns +- 1 ns -> 76.8 ns +- 0.4 ns: 1.56x faster (-36%)
    Significant (t=295.91)

Patch co-written with Serhiy Storchaka.
2017-02-02 12:09:30 +01:00
Victor Stinner fd6d0d2a18 Issue #29368: Fix _Pickle_FastCall() usage in do_append()
_Pickle_FastCall() has a surprising API: it decrements the reference counter of
its second argument.
2017-02-02 10:56:47 +01:00
Serhiy Storchaka bee09aecc2 Issue #29368: The extend() method is now called instead of the append()
method when unpickle collections.deque and other list-like objects.
This can speed up unpickling to 2 times.
2017-02-02 11:12:47 +02:00
Mariatta Wijaya bb19bf275b Issue #29381: merge with 3.6 2017-02-01 21:03:48 -08:00
Mariatta Wijaya 23dcccb75b Issue #29381: Clarify ordering of UNIX shebang line as source encoding line 2017-02-01 20:55:47 -08:00
Mariatta Wijaya 77bb0f4900 Backed out changeset 3d712292f2fa 2017-02-01 20:38:55 -08:00
Mariatta Wijaya e2d8bc52c4 Issue #29381: Clarify ordering of UNIX shebang line as source encoding line 2017-02-01 20:21:22 -08:00
Serhiy Storchaka 495e8808d7 Issue #20185: Converted the int class to Argument Clinic.
Based on patch by Vajrasky Kok.
2017-02-01 23:12:20 +02:00
Berker Peksag ebf8a6d9b0 Issue #29407: Merge from 3.6 2017-02-01 22:38:12 +03:00
Berker Peksag c6fe419d1b Issue #29407: Merge from 3.5 2017-02-01 22:37:49 +03:00
Berker Peksag d5adb63673 Issue #29407: Remove redundant ensure_future() calls in factorial example 2017-02-01 22:37:16 +03:00
Guido van Rossum 934aba66ef Issue #29377: Add three new wrappers to types.py (Manuel Krebber). 2017-02-01 10:55:58 -08:00
Victor Stinner 72268ae1c0 Fix test_gdb.test_wrapper_call() on Python 2
Issue #29367. On Python 2, __init__ name is render as u'__init__'.
2017-02-01 18:26:14 +01:00
Victor Stinner fdbc397f4d Issue #29286: Rename private PyArg_UnpackStack_impl() to unpack_stack()
Rename also "l" argument to "nargs".
2017-02-01 17:42:18 +01:00
Victor Stinner 122fb562d4 Document that _PyFunction_FastCallDict() must copy kwargs
Issue #29318: Caller and callee functions must not share the dictionary:
kwargs must be copied.
2017-02-01 17:04:52 +01:00
Victor Stinner f94b68a025 Make test_gdb.test_wrapper_call() make reliable
Issue #29367. Use two break points to prevent breakpoint during Python
initialization.
2017-02-01 17:00:32 +01:00
Victor Stinner 611083331d python-gdb.py supports method-wrapper
Issue #29367: python-gdb.py now supports also method-wrapper (wrapperobject)
objects.
2017-02-01 16:29:54 +01:00
doko@ubuntu.com c9473b838a Merge 3.6 2017-02-01 13:02:16 +01:00
doko@ubuntu.com f8c5f30303 Merge 3.5 2017-02-01 13:01:54 +01:00
doko@ubuntu.com 137b5a2861 Issue #29169: Fix NEWS entry. 2017-02-01 13:01:17 +01:00
Benjamin Peterson 2145387abc merge 3.6 (#29398) 2017-01-31 23:31:20 -08:00
Benjamin Peterson 2b3f4c1efb merge 3.5 (#29398) 2017-01-31 23:31:10 -08:00
Benjamin Peterson ec977c3028 gc types needs to be allocated as such (closes #29398) 2017-01-31 23:31:02 -08:00
Berker Peksag ef158c3ced Issue #29218: Remove unused install_misc command
It has been documented as unused since 6c6844a2fa30 (2000-05-25)

Patch by Eric N. Vander Weele.
2017-02-01 04:42:48 +03:00
doko@ubuntu.com 9ac4815240 merge 3.6 2017-01-31 13:53:39 +01:00
doko@ubuntu.com cd12f7cb5c merge 3.5 2017-01-31 13:51:21 +01:00
doko@ubuntu.com 34e7e2ecb1 - Issue #29169: Update zlib to 1.2.10. 2017-01-31 13:49:48 +01:00
doko@ubuntu.com a12f123f82 merge 3.6 2017-01-31 13:35:56 +01:00