GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-104469 : Convert _testcapi/dict.c to use AC by jamie2779 · Pull Request #107859 · python/cpython Conversation
|
|
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| _testcapi.dict_getitemstringref | ||
| obj: object | ||
| value: object | ||
| attr_name: str(accept={robuffer}, zeroes=True) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It looks like str(accept={str, NoneType}, zeroes=True) according to https://docs.python.org/3/howto/clinic.html?highlight=clinic#how-to-use-real-argument-clinic-converters-instead-of-legacy-converters
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Hi @erlend-aasland and @AlexWaygood it doesn't work when we use str(accept={str, NoneType}, zeroes=True) grammar even if documentation support it. Would you like to take a look?
Error in file 'Modules/_testcapi/dict.c' on line 260:
str_converter: illegal combination of arguments (frozenset({<class 'NoneType'>, <class 'str'>}), False, True)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The docs are inaccurate; the accept parameter should be accept={robuffer, str, NoneType}. See the definition in clinic.py:
cpython/Tools/clinic/clinic.py
Line 3927 in 23a6db9
| r('z#', zeroes=True, accept={robuffer, str, NoneType}) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Also, it is possible to just use the legacy converter:
| attr_name: str(accept={robuffer}, zeroes=True) | |
| attr_name: 'z#' |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| _testcapi.dict_getitemref | ||
| obj: object | ||
| attr_name: object | ||
| value: object |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is not correct; dict_getitemref only takes two positional-only arguments: obj and attr_name.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| /*[clinic input] | ||
| _testcapi.dict_getitemstringref | ||
| obj: object | ||
| value: object |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Ditto. value is not part of the spec of this method; dict_getitemstringref only takes two positional-only arguments.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| value: object | ||
| key: str(accept={robuffer}, zeroes=True) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The order is incorrect. It should be mapping, key, value.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| _testcapi.dict_getitemstringref | ||
| obj: object | ||
| value: object | ||
| attr_name: str(accept={robuffer}, zeroes=True) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The docs are inaccurate; the accept parameter should be accept={robuffer, str, NoneType}. See the definition in clinic.py:
cpython/Tools/clinic/clinic.py
Line 3927 in 23a6db9
| r('z#', zeroes=True, accept={robuffer, str, NoneType}) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| _testcapi.dict_getitemstringref | ||
| obj: object | ||
| value: object | ||
| attr_name: str(accept={robuffer}, zeroes=True) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Also, it is possible to just use the legacy converter:
| attr_name: str(accept={robuffer}, zeroes=True) | |
| attr_name: 'z#' |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It significantly reduces readability to me. It significantly increases the number of lines in And this is not counting the large amount of code added to another file. I have a limited field of vision and can't see anything beyond a limited number of lines of code. Before that, test functions were compact. After these changes, they will exceed my limit. And if I need to understand what exactly the function does, I have to look for the corresponding code in the generated file and then go back to the previous file, but when I look from the file I lose the context and I have to reread each line on the screen again to find the right place. These changes are not friendly to the visually impaired. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@erlend-aasland @corona10 I have made the requested changes; Please Take Another Look! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I think Serhiy's opinion should be taken into account. Converting _testcapi to Argument Clinic is not of importance. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Closing and re-opening to retrigger CLA checks. Sorry for the noise. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The following commit authors need to sign the Contributor License Agreement: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
close via #104469 (comment) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.