This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steve.dower
Recipients brett.cannon, lukasz.langa, pablogsal, serhiy.storchaka, steve.dower, vstinner
Date 2019-04-29.17:32:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1556559159.26.0.919793271934.issue36751@roundup.psfhosted.org>
In-reply-to
Content
> My proposal was to raise an exception if the input function has positonal arguments

Counter-proposal - just report them as regular position-or-name arguments.

Users of inspect are most likely to be IDEs or editors getting information to present to users. And in my experience, most just ignore all exceptions because bugs cause some function objects to raise errors when trying to inspect them. Which means a new exception will just result in a worse experience for users and no indication of what's wrong.

On the other hand, if there is no change made, they'll just report a normal looking signature until they migrate to using updated Signature objects. Anyone using current Signature objects should similarly get the argument count right, even if they totally ignore the positional-only count. Since one of the arguments for supporting positional-only parameters is that they're for parameters that you'd never consider passing by name, but these tools still need to show a name, very few people should ever be tripped up by them being misreported. And when they do they'll be tripped up very quickly.

Basically, this is not a scenario that *requires* existing users to be broken. So we should avoid breaking them at all costs.
History
Date User Action Args
2019-04-29 17:32:39steve.dowersetrecipients: + steve.dower, brett.cannon, vstinner, lukasz.langa, serhiy.storchaka, pablogsal
2019-04-29 17:32:39steve.dowersetmessageid: <1556559159.26.0.919793271934.issue36751@roundup.psfhosted.org>
2019-04-29 17:32:39steve.dowerlinkissue36751 messages
2019-04-29 17:32:38steve.dowercreate