mirror of
https://github.com/python/cpython.git
synced 2025-09-26 02:10:18 +00:00
gh-113317: Argument Clinic: remove global clinic instance (#115517)
This commit is contained in:
parent
7f074a771b
commit
a0149fa6cf
1 changed files with 3 additions and 7 deletions
|
@ -277,7 +277,7 @@ class Language(metaclass=abc.ABCMeta):
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def render(
|
def render(
|
||||||
self,
|
self,
|
||||||
clinic: Clinic | None,
|
clinic: Clinic,
|
||||||
signatures: Iterable[Module | Class | Function]
|
signatures: Iterable[Module | Class | Function]
|
||||||
) -> str:
|
) -> str:
|
||||||
...
|
...
|
||||||
|
@ -630,7 +630,7 @@ class CLanguage(Language):
|
||||||
|
|
||||||
def render(
|
def render(
|
||||||
self,
|
self,
|
||||||
clinic: Clinic | None,
|
clinic: Clinic,
|
||||||
signatures: Iterable[Module | Class | Function]
|
signatures: Iterable[Module | Class | Function]
|
||||||
) -> str:
|
) -> str:
|
||||||
function = None
|
function = None
|
||||||
|
@ -1584,7 +1584,7 @@ class CLanguage(Language):
|
||||||
|
|
||||||
def render_function(
|
def render_function(
|
||||||
self,
|
self,
|
||||||
clinic: Clinic | None,
|
clinic: Clinic,
|
||||||
f: Function | None
|
f: Function | None
|
||||||
) -> str:
|
) -> str:
|
||||||
if f is None or clinic is None:
|
if f is None or clinic is None:
|
||||||
|
@ -2220,7 +2220,6 @@ class Parser(Protocol):
|
||||||
def parse(self, block: Block) -> None: ...
|
def parse(self, block: Block) -> None: ...
|
||||||
|
|
||||||
|
|
||||||
clinic: Clinic | None = None
|
|
||||||
class Clinic:
|
class Clinic:
|
||||||
|
|
||||||
presets_text = """
|
presets_text = """
|
||||||
|
@ -2345,9 +2344,6 @@ impl_definition block
|
||||||
assert name in self.destination_buffers
|
assert name in self.destination_buffers
|
||||||
preset[name] = buffer
|
preset[name] = buffer
|
||||||
|
|
||||||
global clinic
|
|
||||||
clinic = self
|
|
||||||
|
|
||||||
def add_include(self, name: str, reason: str,
|
def add_include(self, name: str, reason: str,
|
||||||
*, condition: str | None = None) -> None:
|
*, condition: str | None = None) -> None:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue