Thanks to visit codestin.com
Credit goes to github.com

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
gh-136434: Fix docs generation of UnboundItem in subinterpreters (G…
…H-136435)

(cherry picked from commit 3343fce)

Co-authored-by: sobolevn <[email protected]>
  • Loading branch information
sobolevn authored and miss-islington committed Jul 11, 2025
commit e8f1d06cc35d6fa48b30c8fdd3c6a2f7ba14b4e2
19 changes: 12 additions & 7 deletions Lib/concurrent/interpreters/_crossinterp.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,21 @@ class UnboundItem:

@classonly
def singleton(cls, kind, module, name='UNBOUND'):
doc = cls.__doc__.replace('cross-interpreter container', kind)
doc = doc.replace('cross-interpreter', kind)
doc = cls.__doc__
if doc:
doc = doc.replace(
'cross-interpreter container', kind,
).replace(
'cross-interpreter', kind,
)
subclass = type(
f'Unbound{kind.capitalize()}Item',
(cls,),
dict(
_MODULE=module,
_NAME=name,
__doc__=doc,
),
{
"_MODULE": module,
"_NAME": name,
"__doc__": doc,
},
)
return object.__new__(subclass)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix docs generation of ``UnboundItem`` in :mod:`concurrent.interpreters`
when running with :option:`-OO`.
Loading