Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-113317: Argument Clinic: remove global clinic instance #115517

Merged
Merged
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
10 changes: 3 additions & 7 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def __init__(self, filename: str) -> None:
@abc.abstractmethod
def render(
self,
clinic: Clinic | None,
clinic: Clinic,
signatures: Iterable[Module | Class | Function]
) -> str:
...
Expand Down Expand Up @@ -630,7 +630,7 @@ def parse_line(self, line: str) -> None:

def render(
self,
clinic: Clinic | None,
clinic: Clinic,
signatures: Iterable[Module | Class | Function]
) -> str:
function = None
Expand Down Expand Up @@ -1584,7 +1584,7 @@ def render_option_group_parsing(

def render_function(
self,
clinic: Clinic | None,
clinic: Clinic,
f: Function | None
) -> str:
if f is None or clinic is None:
Expand Down Expand Up @@ -2220,7 +2220,6 @@ def __init__(self, clinic: Clinic) -> None: ...
def parse(self, block: Block) -> None: ...


clinic: Clinic | None = None
class Clinic:

presets_text = """
Expand Down Expand Up @@ -2345,9 +2344,6 @@ def __init__(
assert name in self.destination_buffers
preset[name] = buffer

global clinic
clinic = self

def add_include(self, name: str, reason: str,
*, condition: str | None = None) -> None:
try:
Expand Down
Loading