Reuse unchanged string results in affix removal and partitioning (#9324)

* Reuse unchanged string results in affix removal and partitioning

Assisted-by: Codex:GPT-6

* Qualify the ASCII macro in the string test

Assisted-by: Codex:GPT-6
This commit is contained in:
1ndahous3 authored and GitHub committed 2026-10-24 00:59:43 +09:00
1 parent 5dcef1aa6d
commit 3b9a9f4a4c
2 files changed
+64 -39

No files matched your search

+9
View File
@@ -1284,3 +1284,12 @@ def test_percent_callback_order_bounded():
test_percent_callback_order_bounded()
class PartitionString(str):
pass
partition_string = PartitionString("abc")
assert partition_string.partition(":")[0] is partition_string
assert partition_string.rpartition(":")[2] is partition_string