mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
Add weakproxy bytes
This commit is contained in:
1 parent
27884e2d5f
commit
4ac218f90e
2 files changed
+5
-2
No files matched your search
Vendored
-2
@@ -258,8 +258,6 @@ class ReferencesTestCase(TestBase):
|
||||
self.assertEqual(L3[:5], p3[:5])
|
||||
self.assertEqual(L3[2:5], p3[2:5])
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_proxy_unicode(self):
|
||||
# See bug 5037
|
||||
class C(object):
|
||||
|
||||
@@ -78,6 +78,11 @@ impl PyWeakProxy {
|
||||
self.try_upgrade(vm)?.is_true(vm)
|
||||
}
|
||||
|
||||
#[pymethod(magic)]
|
||||
fn bytes(&self, vm: &VirtualMachine) -> PyResult {
|
||||
self.try_upgrade(vm)?.bytes(vm)
|
||||
}
|
||||
|
||||
fn contains(&self, needle: PyObjectRef, vm: &VirtualMachine) -> PyResult<bool> {
|
||||
let obj = self.try_upgrade(vm)?;
|
||||
PySequence::contains(&obj, &needle, vm)
|
||||
|
||||
Reference in new issue
Block a user