Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Lib/test/test_typechecks.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ def testIsSubclassActual(self):
self.assertEqual(issubclass(Integer, Integer), True)
self.assertEqual(issubclass(Integer, (Integer,)), True)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def testSubclassBehavior(self):
self.assertEqual(issubclass(SubInt, Integer), True)
self.assertEqual(issubclass(SubInt, (Integer,)), True)
Expand Down
18 changes: 0 additions & 18 deletions Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,8 +695,6 @@ def f():

self.assertIsInstance(f, HasCallProtocol)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_no_inheritance_from_nominal(self):
class C: pass

Expand All @@ -719,8 +717,6 @@ class E(C, BP): pass
self.assertNotIsInstance(D(), E)
self.assertNotIsInstance(E(), D)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_no_instantiation(self):
class P(Protocol): pass

Expand Down Expand Up @@ -875,8 +871,6 @@ def x(self): ...
with self.assertRaises(TypeError):
issubclass(PG, PG[int])

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_protocols_issubclass_non_callable(self):
class C:
x = 1
Expand Down Expand Up @@ -994,8 +988,6 @@ def __init__(self, x):
self.assertIsInstance(C(1), P)
self.assertIsInstance(C(1), PG)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_protocol_checks_after_subscript(self):
class P(Protocol[T]): pass
class C(P[T]): pass
Expand Down Expand Up @@ -1094,8 +1086,6 @@ def meth(self): pass
self.assertIsInstance(NonPR(), PR)
self.assertIsSubclass(NonPR, PR)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_custom_subclasshook(self):
class P(Protocol):
x = 1
Expand Down Expand Up @@ -1125,8 +1115,6 @@ class C: pass
with self.assertRaises(TypeError):
issubclass(C(), P)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_defining_generic_protocols(self):
T = TypeVar('T')
S = TypeVar('S')
Expand Down Expand Up @@ -1192,8 +1180,6 @@ def bar(self, x: str) -> str:
with self.assertRaises(TypeError):
PR[int, ClassVar]

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_init_called(self):
T = TypeVar('T')

Expand Down Expand Up @@ -1277,8 +1263,6 @@ def meth(self):
self.assertEqual(frozenset(typing._get_protocol_attrs(PG)),
frozenset({'x', 'meth'}))

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_no_runtime_deco_on_nominal(self):
with self.assertRaises(TypeError):
@runtime_checkable
Expand Down Expand Up @@ -2894,8 +2878,6 @@ def test_get_type_hints_modules_forwardref(self):
'default_b': Optional[mod_generics_cache.B]}
self.assertEqual(gth(mod_generics_cache), mgc_hints)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_get_type_hints_classes(self):
self.assertEqual(gth(ann_module.C), # gth will find the right globalns
{'y': Optional[ann_module.C]})
Expand Down
2 changes: 1 addition & 1 deletion vm/src/builtins/mappingproxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl PyMappingProxy {
let opt = match &self.mapping {
MappingProxyInner::Class(class) => {
let key = PyStrRef::try_from_object(vm, key)?;
class.get_attr(key.as_str())
class.attributes.read().get(key.as_str()).cloned()
}
MappingProxyInner::Dict(obj) => obj.get_item(key, vm).ok(),
};
Expand Down