Closed mtreglia-gpsw closed 2 months ago
Hi @mtreglia-gpsw, my currently understanding is that Python docs nudge towards what we would call nowadays "protocol".
When discussing protocols in this context, the feedback that I once got was the following:
Protocols should usually have positional-only parameters, because otherwise implementations need to use the exact same parameter names. Use positional-or-keyword parameters only if consumers of the protocol pass keyword arguments.
So I think it makes more sense for "client code" to use positional-style calling conventions. Otherwise it will always be at the risk of exceptions. For example, in the code snippet that you gave, I think that at least relying on fullname=
keyword style invocation is problematic.
That said, I am happy to consider a PR (we probably need to add the specific type: ignore
annotation though). Would you like to submit one?
Hi @abravalheri , thanks for the quickly reply.
I see, thanks also for sharing the conversation link, indeed the protocol in _typeshed.importlib
seems to be the way 👍 .
I'w be glad to propose a PR in the following days.
Hi @abravalheri, I made the PR, could you have a look please ? https://github.com/pypa/setuptools/pull/4470 Thanks in advance.
Thank you very much for the PR.
This will be available on the next release of setuptools.
setuptools version
setuptools>=70.0.0
Python version
Python3.10
OS
macOS
Additional environment information
Using a custom implementation for live reloading python code.
Description
Upgrading to
setuptools>=70.0.0
I notice some failure in some simple use case due to the change of signature of the_EditableFinder
used when a python module is installed in editable mode.The change was introduced in this commit-19b63d1b and it alter the standard signature of the classmethod find_spec of a
PathFinder
.In fixing the
PathEntryFinder
a change of the signature was introduced for argument_path
and_target
:Expected behavior
The
_EditableFinder
use the standardPathFinder
naming convention for the methods's arguments.How to Reproduce
main
Output