And in fact *use* typing_extensions, which is sometimes the only way to
get access to TypedDict.
Mostly, reindent almost but not quite an entire file to only define
annotation classes under TYPE_CHECKING.
This is a pretty common pattern in python (the standard library uses it
a ton): A class is created, with a single private instance in the
module, and then it's methods are exposed as public API. This removes
the need for the global statement, and is generally a little easier to
reason about thanks to encapsulation.
The title is used only in the sidebar. There is no need to have
"extends" information there. For returned objects the actual name is not
meaningful so it's better to use the long name. For builtin objects the
name is important because that's the global variable name.
Regressed in commit bfb12222c3.
This needs to iterate over all methods, process them, and add them to a
list. Instead, it deleted all methods, processed all remaining methods,
and appended them to the in-use iterator.
Use a second list, instead.
Fixes#9922