Skip to content

gh-113317: Remove Argument Clinic global variable 'clinic' - #114752

Closed
vstinner wants to merge 1 commit into
python:mainfrom
vstinner:ac_location
Closed

gh-113317: Remove Argument Clinic global variable 'clinic'#114752
vstinner wants to merge 1 commit into
python:mainfrom
vstinner:ac_location

Conversation

@vstinner

@vstinnervstinner commented Jan 30, 2024

Copy link
Copy Markdown
Member
  • Add Clinic.warn() and Clinic.fail() methods.
  • Add filename parameter to BlockParser constructor.
  • Add BlockParser.fail() method.
  • Add DSLParser.fail() method.
  • Pass lineno parameter to DSLParser.format_docstring(): more accurate error reporting.
  • Convert a few DSLParser static methods to regular method to be able to call self.fail().
  • Language.render() clinic parameter is now required: None is no longer accepted.
  • Remove warn() function.
  • Remove global variable 'clinic'.

fail() and warn() methods get filename and line number from the instance on which the method is called, rather than relying on a global variable 'clinic'.

* Add Clinic.warn() and Clinic.fail() methods.
* Add filename parameter to BlockParser constructor.
* Add BlockParser.fail() method.
* Add DSLParser.fail() method.
* Pass lineno parameter to DSLParser.format_docstring(): more
accurate error reporting.
* Convert a few DSLParser static methods to regular method to be able
to call self.fail().
* Language.render() clinic parameter is now required: None is no
longer accepted.
* Remove warn() function.
* Remove global variable 'clinic'.
fail() and warn() methods get filename and line number from the
instance on which the method is called, rather than relying on a
global variable 'clinic'.
@vstinner

Copy link
Copy Markdown
MemberAuthor

@erlend-aasland@AlexWaygood: Would you mind to review this change?

@erlend-aasland wrote a different approach: https://github.com/Argument-Clinic/cpython/pull/35

@vstinner

Copy link
Copy Markdown
MemberAuthor

@AlexWaygood

Copy link
Copy Markdown
Member

I'm stepping down as an AC maintainer for now :) #114796

I trust you two to come to the right decision!

@AlexWaygood
AlexWaygood removed their request for review January 31, 2024 11:40
@vstinner

Copy link
Copy Markdown
MemberAuthor

I'm stepping down as an AC maintainer for now :) #114796

Even if you're not officially an "expert" or "code owner", your opinion still matters for me, and you're free to pick some reviews whenever you want. But I understand that I should ping you less often on such AC changes ;-)

@vstinner

Copy link
Copy Markdown
MemberAuthor

Ping @erlend-aasland: Gentle reminder that I'm looking for a review :-)

@erlend-aasland

Copy link
Copy Markdown
Contributor

Superseded by #115517.

@vstinner
vstinner deleted the ac_location branch January 14, 2025 08:20
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@vstinner@AlexWaygood@erlend-aasland