Skip to content

Commit

Permalink
documentation/python: typing.Generic.__new__() is gone in 3.9.
Browse files Browse the repository at this point in the history
  • Loading branch information
mosra committed Jan 3, 2022
1 parent 2888f19 commit 7301a85
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>inspect_annotations.AContainer | My Python Project</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
<link rel="stylesheet" href="m-dark+documentation.compiled.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<header><nav id="navigation">
<div class="m-container">
<div class="m-row">
<a href="index.html" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">My Python Project</a>
</div>
</div>
</nav></header>
<main><article>
<div class="m-container m-container-inflatable">
<div class="m-row">
<div class="m-col-l-10 m-push-l-1">
<h1>
<span class="m-breadcrumb"><a href="inspect_annotations.html">inspect_annotations</a>.<wbr/></span>AContainer <span class="m-thin">class</span>
</h1>
<p>A generic class. No parent class info extracted yet.</p>
<div class="m-block m-default">
<h3>Contents</h3>
<ul>
<li>
Reference
<ul>
<li><a href="#dunder-methods">Special methods</a></li>
</ul>
</li>
</ul>
</div>
<section id="dunder-methods">
<h2><a href="#dunder-methods">Special methods</a></h2>
<dl class="m-doc">
<dt id="__new__">
<span class="m-doc-wrap-bumper">def <a href="#__new__" class="m-doc-self">__new__</a>(</span><span class="m-doc-wrap">cls, *args, **kwds)</span>
</dt>
<dd></dd>
</dl>
</section>
</div>
</div>
</div>
</article></main>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,6 @@ <h1>
<span class="m-breadcrumb"><a href="inspect_annotations.html">inspect_annotations</a>.<wbr/></span>AContainer <span class="m-thin">class</span>
</h1>
<p>A generic class. No parent class info extracted yet.</p>
<div class="m-block m-default">
<h3>Contents</h3>
<ul>
<li>
Reference
<ul>
<li><a href="#dunder-methods">Special methods</a></li>
</ul>
</li>
</ul>
</div>
<section id="dunder-methods">
<h2><a href="#dunder-methods">Special methods</a></h2>
<dl class="m-doc">
<dt id="__new__">
<span class="m-doc-wrap-bumper">def <a href="#__new__" class="m-doc-self">__new__</a>(</span><span class="m-doc-wrap">cls, *args, **kwds)</span>
</dt>
<dd></dd>
</dl>
</section>
</div>
</div>
</div>
Expand Down
8 changes: 6 additions & 2 deletions documentation/test_python/test_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,12 @@ def test(self):
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'),
Expand Down

0 comments on commit 7301a85

Please sign in to comment.