Commit Graph

97715 Commits

Author SHA1 Message Date
Victor Stinner a5ed5f000a Use _PyObject_CallNoArg()
Replace:
    PyObject_CallObject(callable, NULL)
with:
    _PyObject_CallNoArg(callable)
2016-12-06 18:45:50 +01:00
Victor Stinner 2a358f862b Issue #28838: Fix weird indentation of abstract.h
Remove most indentation to move code at the left.
2016-12-06 16:55:39 +01:00
Serhiy Storchaka ff3dbe9141 Merge documentation for issue #27030 from 3.6. 2016-12-06 19:25:19 +02:00
Serhiy Storchaka 53c53ea4c5 Issue #27030: Unknown escapes in re.sub() replacement template are allowed
again.  But they still are deprecated and will be disabled in 3.7.
2016-12-06 19:15:29 +02:00
Victor Stinner 2d0eb65f45 Uniformize argument names of "call" functions
Issue #28838: Rename parameters of the "calls" functions of the Python C API.

* Rename 'callable_object' and 'func' to 'callable': any Python callable object
  is accepted, not only Python functions
* Rename 'method' and 'nameid' to 'name' (method name)
* Rename 'o' to 'obj'
* Move, fix and update documentation of PyObject_CallXXX() functions
  in abstract.h
* Update also the documentaton of the C API (update parameter names)
2016-12-06 16:27:24 +01:00
Serhiy Storchaka 89072047b8 Fixed misplaced comment. 2016-12-06 13:46:17 +02:00
Serhiy Storchaka b0f75c520e Fixed misplaced comment. 2016-12-06 13:45:44 +02:00
Serhiy Storchaka e503126074 Fixed misplaced comment. 2016-12-06 13:43:46 +02:00
Victor Stinner b38e83df33 Merge 3.6 2016-12-06 11:02:54 +01:00
Victor Stinner 8ae9e6a627 warnings: Fix the issue number
The fix for catch_warnings() is the issue #28835 (not the issue #28089).
2016-12-06 11:02:12 +01:00
Victor Stinner 01928f6c0f Merge 3.6 2016-12-06 10:59:54 +01:00
Victor Stinner 8ef46be26a catch_warnings() calls showwarning() if overriden
Issue #28089: Fix a regression introduced in warnings.catch_warnings(): call
warnings.showwarning() if it was overriden inside the context manager.
2016-12-06 10:53:52 +01:00
Benjamin Peterson 16e49bf4f1 merge 3.6 2016-12-05 22:31:20 -08:00
Benjamin Peterson 3d3e9ffa8e merge 3.5 2016-12-05 22:31:12 -08:00
Benjamin Peterson 41fef63076 rm unused import 2016-12-05 22:30:55 -08:00
Serhiy Storchaka 6bc7fa28dd Fixed merge error in Misc/NEWS for issue #23722. 2016-12-06 00:24:19 +02:00
Serhiy Storchaka fb3134f4d4 Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions. 2016-12-06 00:20:26 +02:00
Serhiy Storchaka 9a953dbb34 Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions. 2016-12-06 00:17:45 +02:00
Serhiy Storchaka 419967b832 Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions. 2016-12-06 00:13:34 +02:00
Victor Stinner 9083eb6aac Use directly _PyObject_GenericSetAttrWithDict()
Modify type_setattro() to call directly _PyObject_GenericSetAttrWithDict()
instead of PyObject_GenericSetAttr().

PyObject_GenericSetAttr() is a thin wrapper to
_PyObject_GenericSetAttrWithDict().
2016-12-05 18:23:27 +01:00
Victor Stinner 408bfa6d96 Issue #28152: Fix -Wunreachable-code warning on clang
Replace 0 with (0) to ignore a compiler warning about dead code on
"((int)(SEM_VALUE_MAX) < 0)": SEM_VALUE_MAX is not negative on Linux.
2016-12-05 18:00:42 +01:00
Victor Stinner 44d9bea1b8 Issue #28152: Fix -Wunreachable-code warning on clang
Replace C if() with precompiler #if to fix a warning on dead code when using
clang.
2016-12-05 17:55:36 +01:00
Victor Stinner 9a2329f9e1 Issue #28152: Fix -Wunreachable-code warnings on Clang
Don't declare dead code when the code is declared with Clang.
2016-12-05 17:56:36 +01:00
Victor Stinner 7bfb42d5b7 Issue #28858: Remove _PyObject_CallArg1() macro
Replace
   _PyObject_CallArg1(func, arg)
with
   PyObject_CallFunctionObjArgs(func, arg, NULL)

Using the _PyObject_CallArg1() macro increases the usage of the C stack, which
was unexpected and unwanted. PyObject_CallFunctionObjArgs() doesn't have this
issue.
2016-12-05 17:04:32 +01:00
Nick Coghlan d77e5b7211 Merge #23722 from 3.6 2016-12-05 16:59:22 +10:00
Nick Coghlan 19d246745d Issue #23722: improve __classcell__ compatibility
Handling zero-argument super() in __init_subclass__ and
__set_name__ involved moving __class__ initialisation to
type.__new__. This requires cooperation from custom
metaclasses to ensure that the new __classcell__ entry
is passed along appropriately.

The initial implementation of that change resulted in abruptly
broken zero-argument super() support in metaclasses that didn't
adhere to the new requirements (such as Django's metaclass for
Model definitions).

The updated approach adopted here instead emits a deprecation
warning for those cases, and makes them work the same way they
did in Python 3.5.

This patch also improves the related class machinery documentation
to cover these details and to include more reader-friendly
cross-references and index entries.
2016-12-05 16:47:55 +10:00
Victor Stinner de4ae3d486 Backed out changeset b9c9691c72c5
Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like
_PyObject_CallArg1() uses more stack memory than
PyObject_CallFunctionObjArgs().
2016-12-04 22:59:09 +01:00
Raymond Hettinger c8d03187ff merge 2016-12-04 11:00:57 -08:00
Raymond Hettinger 71c62e14aa Neaten-up and extend the examples in the random module docs. 2016-12-04 11:00:34 -08:00
Serhiy Storchaka 8209cec0bd Fixed mismatching title overline. 2016-12-04 15:43:57 +02:00
Serhiy Storchaka 223813111e Fixed mismatching title overline. 2016-12-04 15:43:37 +02:00
Serhiy Storchaka 7bc01c32b1 Fixed mismatching title overline. 2016-12-04 15:42:13 +02:00
Serhiy Storchaka a8037db69d Fixed double hyphens that are rendered to literal en-dashes in the documenation. 2016-12-04 10:22:36 +02:00
Serhiy Storchaka e418432dfb Fixed double hyphens that are rendered to literal en-dashes in the documenation. 2016-12-04 10:22:09 +02:00
Serhiy Storchaka 29b0a26822 Fixed double hyphens that are rendered to literal en-dashes in the documenation. 2016-12-04 10:20:55 +02:00
Steve Dower ed04388328 Null merge with 3.6 2016-12-03 15:57:15 -08:00
Steve Dower 21cf577526 Revert unintended merge 2016-12-03 15:57:00 -08:00
Steve Dower 01a057aff4 Revert unintended merge 2016-12-03 12:12:23 -08:00
Steve Dower 9cc113a8f7 Issue #28846: Various installer fixes 2016-12-03 12:11:25 -08:00
Steve Dower f00ef72ee1 Ensures intermediate directory is created before using it 2016-12-03 11:56:44 -08:00
Steve Dower de6efdb772 Ensures intermediate directory is created before accessing it. 2016-12-03 11:56:20 -08:00
Steve Dower 1058109b31 Issue #28846: Various installer fixes 2016-12-03 11:24:02 -08:00
Steve Dower 190dbd9ba2 Issue #28846: Various installer fixes 2016-12-03 11:18:53 -08:00
Serhiy Storchaka 2d397dc44b Merge heads 2016-12-02 23:34:24 +02:00
Serhiy Storchaka 853ec5d408 Issue #21818: Fixed references to classes that have names matching with module
names.
2016-12-02 23:15:42 +02:00
Serhiy Storchaka b6a6b45458 Issue #21818: Fixed references to classes that have names matching with module
names.
2016-12-02 23:15:22 +02:00
Serhiy Storchaka ee1b01a41b Issue #21818: Fixed references to classes that have names matching with module
names.
2016-12-02 23:13:53 +02:00
Serhiy Storchaka 4700d86488 Merge from 3.6. 2016-12-02 21:38:46 +02:00
Serhiy Storchaka b93626404c Null merge 2016-12-02 21:33:05 +02:00
Nick Coghlan 3c35fdb8fb Issue #27172: Undeprecate inspect.getfullargspec()
This is still useful for single source Python 2/3 code
migrating away from inspect.getargspec(), but that wasn't
clear with the documented deprecation in place.
2016-12-02 20:29:57 +10:00