bpo-29463 added optional "docstring" field to 4 AST types.
While it is optional, it breaks backward compatibility because AST constructor
requires number of positional argument is same to number of fields.
AST types accepts empty arguments, and incomplete keyword arguments.
But it's not big problem because field can be filled after creation, and checked when compiling.
So stop requiring complete set of fields for positional arguments too.
When you use `'%s' % SubClassOfStr()`, where `SubClassOfStr.__rmod__` exists, the reverse operation is ignored as normally such string formatting operations use the `PyUnicode_Format()` fast path. This patch tests for subclasses of `str` first and picks the slow path in that case.
Patch by Martijn Pieters.
* bpo-29463: Add docstring field to some AST nodes.
ClassDef, ModuleDef, FunctionDef, and AsyncFunctionDef has docstring
field for now. It was first statement of there body.
* fix document. thanks travis!
* doc fixes
* Fixed bpo-29565: Corrected ctypes passing of large structs by value.
Added code and test to check that when a structure passed by value
is large enough to need to be passed by reference, a copy of the
original structure is passed. The callee updates the passed-in value,
and the test verifies that the caller's copy is unchanged. A similar
change was also added to the test added for bpo-20160 (that test was
passing, but the changes should guard against regressions).
* Reverted unintended whitespace changes.
``local.getlocale(locale.LC_CTYPE)`` and
``locale.getpreferredencoding(False)`` may give different answers
in some cases (such as the ``en_IN`` locale).
``re.LOCALE`` uses the latter, so update the test case to match.
It took me quite a bit to figure out what this was referring to,
since the given issue number is wrong, and the original commit
message I found through git blame lists a different, also wrong
issue number... see https://bugs.python.org/issue27122#msg279449
test_unraisable() of test_exceptions expects that PyErr_WriteUnraisable(method)
fails on repr(method).
Before the previous change (7b8df4a5d81d), slot_tp_finalize() called
PyErr_WriteUnraisable() with a PyMethodObject. In this case, repr(method) calls
repr(self) which is BrokenRepr.__repr__() and the calls raises a new exception.
After the previous change, slot_tp_finalize() uses an unbound method: repr() is
called on a regular __del__() method which doesn't call repr(self). repr()
doesn't fail anymore.
PyErr_WriteUnraisable() doesn't call __repr__() anymore, so remove BrokenRepr
unit test.
Issue #29362: Catch a crash of a worker process as a normal failure and
continue to run next tests. It allows to get the usual test summary: single
line result (OK/FAIL), total duration, etc.