◐ Shell
clean mode source ↗

bpo-28598: Support __rmod__ for RHS subclasses of str in % string formatting operations by mjpieters · Pull Request #51 · python/cpython

…rations.

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.

Fixes issue28598.

@berkerpeksag berkerpeksag changed the title Support __rmod__ for RHS subclasses of str in % string formatting operations bpo-28598: Support __rmod__ for RHS subclasses of str in % string formatting operations

Feb 12, 2017

serhiy-storchaka

serhiy-storchaka

This was referenced

Feb 14, 2017

@serhiy-storchaka

colesbury referenced this pull request in colesbury/nogil

Oct 6, 2021

jaraco pushed a commit that referenced this pull request

Dec 2, 2022
Allow miss-islington to merge the PR if all of these conditions met:
- All CI passed
- At least one core dev approved
- PR is made by miss-islington

jaraco pushed a commit to jaraco/cpython that referenced this pull request

Feb 17, 2023
Back port latest changes to importlib.resources

Closes python#51

See merge request python-devs/importlib_resources!55

mgmacias95 pushed a commit to mgmacias95/cpython that referenced this pull request

Mar 24, 2023

oraluben pushed a commit to oraluben/cpython that referenced this pull request

Jul 11, 2023
…ython#51)

* feat: store bb_test flag in frame to reload during resume

* feat: bigger CACHE entries for everything, CACHE for JUMP_BACKWARD

* nit: increase overallocate factor even more

* feat: remove bb_flag/bb_test and use only the frame's

This was referenced

Feb 11, 2025

DinoV added a commit to DinoV/cpython that referenced this pull request

Feb 11, 2026