Skip to content

Commit 093ba25

Browse files
authored
Merge pull request #5377 from youknowone/inspect
Update dataclasses, inspect from CPython 3.13
2 parents 6f80505 + 9bbfdf5 commit 093ba25

25 files changed

+10905
-900
lines changed

Lib/dataclasses.py

Lines changed: 460 additions & 283 deletions
Large diffs are not rendered by default.

Lib/dis.py

Lines changed: 1054 additions & 0 deletions
Large diffs are not rendered by default.

Lib/inspect.py

Lines changed: 876 additions & 565 deletions
Large diffs are not rendered by default.

Lib/test/test__opcode.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def test_invalid_opcodes(self):
2727
self.check_bool_function_result(_opcode.has_local, invalid, False)
2828
self.check_bool_function_result(_opcode.has_exc, invalid, False)
2929

30-
@unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: module 'dis' has no attribute 'opmap'
3130
def test_is_valid(self):
3231
names = [
3332
'CACHE',
@@ -39,7 +38,6 @@ def test_is_valid(self):
3938
opcodes = [dis.opmap[opname] for opname in names]
4039
self.check_bool_function_result(_opcode.is_valid, opcodes, True)
4140

42-
@unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: module 'dis' has no attribute 'hasarg'
4341
def test_oplists(self):
4442
def check_function(self, func, expected):
4543
for op in [-10, 520]:

Lib/test/test_abc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ def method_two(self):
168168
msg = r"class C without an implementation for abstract methods 'method_one', 'method_two'"
169169
self.assertRaisesRegex(TypeError, msg, C)
170170

171+
# TODO: RUSTPYTHON; AssertionError: False is not true
172+
@unittest.expectedFailure
171173
def test_abstractmethod_integration(self):
172174
for abstractthing in [abc.abstractmethod, abc.abstractproperty,
173175
abc.abstractclassmethod,

Lib/test/test_compile.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,8 +1070,6 @@ def if_else_break():
10701070
elif instr.opname in HANDLED_JUMPS:
10711071
self.assertNotEqual(instr.arg, (line + 1)*INSTR_SIZE)
10721072

1073-
# TODO: RUSTPYTHON
1074-
@unittest.expectedFailure
10751073
def test_no_wraparound_jump(self):
10761074
# See https://bugs.python.org/issue46724
10771075

Lib/test/test_copy.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,8 +961,6 @@ class PointFromClass(NamedTuple):
961961
with self.assertRaisesRegex(TypeError, 'unexpected field name'):
962962
copy.replace(p, x=1, error=2)
963963

964-
# TODO: RUSTPYTHON
965-
@unittest.expectedFailure
966964
def test_dataclass(self):
967965
from dataclasses import dataclass
968966
@dataclass

0 commit comments

Comments
 (0)