Steve Dower <steve.do...@python.org> added the comment:

> 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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36751>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to