mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
[3.11] gh-95987: Fix repr
of Any
type subclasses (GH-96412) (#96451)
(cherry picked from commit 4217393
)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
parent
8c6ced36ab
commit
c9eacc8d02
3 changed files with 10 additions and 1 deletions
|
@ -109,6 +109,12 @@ class AnyTests(BaseTestCase):
|
|||
def test_repr(self):
|
||||
self.assertEqual(repr(Any), 'typing.Any')
|
||||
|
||||
class Sub(Any): pass
|
||||
self.assertEqual(
|
||||
repr(Sub),
|
||||
"<class 'test.test_typing.AnyTests.test_repr.<locals>.Sub'>",
|
||||
)
|
||||
|
||||
def test_errors(self):
|
||||
with self.assertRaises(TypeError):
|
||||
issubclass(42, Any)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue