mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 10:44:36 +08:00
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:
1 parent
5dcef1aa6d
commit
3b9a9f4a4c
2 files changed
+64
-39
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user