mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Merge pull request #868 from skinny121/rpartition_bug
Fix rpartition bug
This commit is contained in:
@@ -132,7 +132,9 @@ assert 'abc\t12345\txyz'.expandtabs() == 'abc 12345 xyz'
|
||||
assert '-'.join(['1', '2', '3']) == '1-2-3'
|
||||
assert 'HALLO'.isupper()
|
||||
assert "hello, my name is".partition("my ") == ('hello, ', 'my ', 'name is')
|
||||
assert "hello".partition("is") == ('hello', '', '')
|
||||
assert "hello, my name is".rpartition("is") == ('hello, my name ', 'is', '')
|
||||
assert "hello".rpartition("is") == ('', '', 'hello')
|
||||
assert not ''.isdecimal()
|
||||
assert '123'.isdecimal()
|
||||
assert not '\u00B2'.isdecimal()
|
||||
|
||||
@@ -635,9 +635,9 @@ impl PyString {
|
||||
new_tup.swap(0, 1); // so it's in the right order
|
||||
new_tup.insert(1, vm.ctx.new_str(sub.clone()));
|
||||
} else {
|
||||
new_tup.push(vm.ctx.new_str("".to_string()));
|
||||
new_tup.push(vm.ctx.new_str("".to_string()));
|
||||
new_tup.push(vm.ctx.new_str(value.clone()));
|
||||
new_tup.push(vm.ctx.new_str("".to_string()));
|
||||
new_tup.push(vm.ctx.new_str("".to_string()));
|
||||
}
|
||||
vm.ctx.new_tuple(new_tup)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user