You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Argument Clinic no longer works with single optional argument #68239
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2015-05-03.20:14:52.510>created_at=<Date2015-04-24.13:48:50.646>labels= ['type-bug', 'expert-argument-clinic']
title='Argument Clinic no longer works with single optional argument'updated_at=<Date2015-05-03.20:14:52.509>user='https://github.com/serhiy-storchaka'
Then it would be better to not convert wantobjects() to Argument Clinic. Using -1 as a value for not passed argument is a hack (added in 1ab9978123be) and I don't want to propagate it to the signature.
But I afraid that there are other functions that suffer from this bug (may be in the curses module).
If the argument currently uses a default value of -1, then I see no problem with converting it to Argument Clinic using a default value of -1. If you claim it's a "hack" then you should discuss that with the author of 1ab9978123be.
Activity
serhiy-storchaka commentedon Apr 24, 2015
Argument Clinic no longer works single optional argument. For example see _tkinter.tkapp.wantobjects in the patch in bpo-20168.
/*[clinic input]
_tkinter.tkapp.wantobjects
[clinic start generated code]*/
It is converted to the methoddef of type METH_O.
As result wantobjects() can't be called without an argument.
larryhastings commentedon May 3, 2015
Optional groups were designed to support two specific legacy use cases:
They are not intended to be used in cases like this. I really, really wish you would stop using them except for these specific legacy cases.
Furthermore, the argument parsing for tkinter.tkapp.wantobjects has a very clear translation into Argument Clinic:
Optional groups should not be used for single-argument functions. I have no interest in fixing this bug.
larryhastings commentedon May 3, 2015
Sorry, I forgot to finish the first bullet point. It should have read:
serhiy-storchaka commentedon May 3, 2015
Then it would be better to not convert wantobjects() to Argument Clinic. Using -1 as a value for not passed argument is a hack (added in 1ab9978123be) and I don't want to propagate it to the signature.
But I afraid that there are other functions that suffer from this bug (may be in the curses module).
larryhastings commentedon May 3, 2015
If the argument currently uses a default value of -1, then I see no problem with converting it to Argument Clinic using a default value of -1. If you claim it's a "hack" then you should discuss that with the author of 1ab9978123be.
larryhastings commentedon May 3, 2015
Closing as wontfix. This is not a supported use of optional groups.