From: Vladimír Vondruš Date: Sun, 2 Jan 2022 21:21:50 +0000 (+0100) Subject: documentation/python: typing.Generic.__new__() is gone in 3.9. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=7301a85b2cef514229073ad11ef6ad1ebae87b1b;p=blog.git documentation/python: typing.Generic.__new__() is gone in 3.9. --- diff --git a/documentation/test_python/inspect_annotations/inspect_annotations.AContainer-py36-38.html b/documentation/test_python/inspect_annotations/inspect_annotations.AContainer-py36-38.html new file mode 100644 index 00000000..fcc0e6e5 --- /dev/null +++ b/documentation/test_python/inspect_annotations/inspect_annotations.AContainer-py36-38.html @@ -0,0 +1,51 @@ + + + + + inspect_annotations.AContainer | My Python Project + + + + + +
+
+ + diff --git a/documentation/test_python/inspect_annotations/inspect_annotations.AContainer.html b/documentation/test_python/inspect_annotations/inspect_annotations.AContainer.html index fcc0e6e5..4cce96c6 100644 --- a/documentation/test_python/inspect_annotations/inspect_annotations.AContainer.html +++ b/documentation/test_python/inspect_annotations/inspect_annotations.AContainer.html @@ -23,26 +23,6 @@ inspect_annotations.AContainer class

A generic class. No parent class info extracted yet.

-
-

Contents

- -
-
-

Special methods

-
-
- def __new__(cls, *args, **kwds) -
-
-
-
diff --git a/documentation/test_python/test_inspect.py b/documentation/test_python/test_inspect.py index e8823904..8c5a642a 100644 --- a/documentation/test_python/test_inspect.py +++ b/documentation/test_python/test_inspect.py @@ -92,8 +92,12 @@ class Annotations(BaseInspectTestCase): self.assertEqual(*self.actual_expected_contents('inspect_annotations.Foo.html')) self.assertEqual(*self.actual_expected_contents('inspect_annotations.FooSlots.html')) - # This should not list any internal stuff from the typing module - self.assertEqual(*self.actual_expected_contents('inspect_annotations.AContainer.html')) + # This should not list any internal stuff from the typing module. The + # Generic.__new__() is gone in 3.9: https://bugs.python.org/issue39168 + if LooseVersion(sys.version) >= LooseVersion('3.9.0'): + self.assertEqual(*self.actual_expected_contents('inspect_annotations.AContainer.html')) + else: + self.assertEqual(*self.actual_expected_contents('inspect_annotations.AContainer.html', 'inspect_annotations.AContainer-py36-38.html')) # https://github.com/python/cpython/pull/13394 @unittest.skipUnless(LooseVersion(sys.version) >= LooseVersion('3.7.4'),