Uh oh!
There was an error while loading. Please reload this page.
gh-140382: Add support for __getattr__ method to Argument Clinic - #140376
gh-140382: Add support for __getattr__ method to Argument Clinic#140376StanFromIreland wants to merge 4 commits into
__getattr__ method to Argument Clinic#140376Conversation
merwok
commented
Oct 20, 2025
Could you create a new issue for this, and tag people interested in AC? |
StanFromIreland
commented
Oct 20, 2025
I can create a new issue, but all CODEOWNERs have already been notified. Do you have anyone else in mind? |
__getattr__ method to Argument Clinic__getattr__ method to Argument Clinic
ZeroIntensity
left a comment
There was a problem hiding this comment.
Wouldn't it make more sense to just support arbitrary dunder methods? __getattr__ isn't very common in C code, among other things.
I'm also not convinced this is worth it. A |
ZeroIntensity
commented
Oct 20, 2025
On the other hand, I would be very supportive of allowing arbitrary dunders in AC, though I suspect that would be a lot of extra work (because we would need to map dunders to |
merwok
commented
Oct 20, 2025
No, it’s just the general principle that «should we do?» discussions happen in issues (and when needed on the forums), then the PR can host «how to do?» discussions. |
skirpichev
left a comment
There was a problem hiding this comment.
Wouldn't it make more sense to just support arbitrary dunder methods?
I think it's ok to add support of specific dunders on-demand. It's not too helpful in general, because sometimes we can do too much with slots, even override the docstring.
But please think about more generic case. For example, for most dunders we have very specific function signatures. It will be redundant and error-prone to specify this stuff by hand.
Uh oh!
There was an error while loading. Please reload this page.
vstinner
commented
Oct 28, 2025
I would prefer to only add support when it will really be needed, so we can test on actual code rather than unit tests. In short, I'm supportive of only adding support for |
ZeroIntensity
commented
Oct 28, 2025
I don't think that will work well in practice. Judging by this PR, adding support for a new dunder method seems non-trivial. People will probably decide to just write things the old way instead of updating clinic, which we don't want. |
StanFromIreland
commented
Mar 7, 2026
Closing, there is little need and support for this. |
__getattr__method in AC #140382