Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 35.2k
gh-117431: Argument Clinic: copy forced text signature when cloning#117591
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
5bafa02fd9f70686f7b4a2d193aa0a25324ae0fa89File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -666,6 +666,8 @@ def state_modulename_name(self, line: str) -> None: | ||
| if equals: | ||
| existing = existing.strip() | ||
| if libclinic.is_legal_py_identifier(existing): | ||
| if self.forced_text_signature: | ||
| fail("Cannot use @text_signature when cloning a function") | ||
erlend-aasland marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| # we're cloning! | ||
| names = self.parse_function_names(before) | ||
| return self.parse_cloned_function(names, existing) | ||
| @@ -689,7 +691,8 @@ def state_modulename_name(self, line: str) -> None: | ||
| kind=self.kind, | ||
| coexist=self.coexist, | ||
| critical_section=self.critical_section, | ||
| target_critical_section=self.target_critical_section | ||
| target_critical_section=self.target_critical_section, | ||
| forced_text_signature=self.forced_text_signature | ||
| ) | ||
| self.add_function(func) | ||
| @@ -1324,13 +1327,14 @@ def state_function_docstring(self, line: str) -> None: | ||
| self.docstring_append(self.function, line) | ||
| @staticmethod | ||
| def format_docstring_signature( | ||
| self, f: Function, parameters: list[Parameter] | ||
| f: Function, parameters: list[Parameter] | ||
| ) -> str: | ||
| lines = [] | ||
| lines.append(f.displayname) | ||
| if self.forced_text_signature: | ||
| lines.append(self.forced_text_signature) | ||
| if f.forced_text_signature: | ||
| lines.append(f.forced_text_signature) | ||
| elif f.kind in {GETTER, SETTER}: | ||
| # @getter and @setter do not need signatures like a method or a function. | ||
| return '' | ||
Uh oh!
There was an error while loading. Please reload this page.