summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorMartijn Pieters <github.com@zopatista.com>2017-02-23 13:38:04 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-02-23 13:38:04 (GMT)
commitd7e64337ef45085792b382a09f5b3a45d3687c8c (patch)
treee564cb5e7c44b866630e0de6550b6862f82a3a68 /Misc
parent2771304357607aa62801a67acc1e3c7c8ec489ce (diff)
downloadcpython-d7e64337ef45085792b382a09f5b3a45d3687c8c.zip
cpython-d7e64337ef45085792b382a09f5b3a45d3687c8c.tar.gz
cpython-d7e64337ef45085792b382a09f5b3a45d3687c8c.tar.bz2
bpo-28598: Support __rmod__ for RHS subclasses of str in % string formatting operations (#51)
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.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS4
1 files changed, 4 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index e21a723..72d96e7 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@ What's New in Python 3.7.0 alpha 1?
Core and Builtins
-----------------
+- bpo-28598: Support __rmod__ for subclasses of str being called before
+ str.__mod__. Patch by Martijn Pieters.
+
- bpo-29607: Fix stack_effect computation for CALL_FUNCTION_EX.
Patch by Matthieu Dartiailh.
@@ -19,6 +22,7 @@ Core and Builtins
- bpo-29347: Fixed possibly dereferencing undefined pointers
when creating weakref objects.
+
- bpo-29463: Add ``docstring`` field to Module, ClassDef, FunctionDef,
and AsyncFunctionDef ast nodes. docstring is not first stmt in their body
anymore. It affects ``co_firstlineno`` and ``co_lnotab`` of code object