GH-74460: Renamed name argument to fullname for importlib.machinery.ExtensionFileLoader#92300
GH-74460: Renamed name argument to fullname for importlib.machinery.ExtensionFileLoader#92300achhina wants to merge 2 commits into
Conversation
|
Hi, @brettcannon and @serhiy-storchaka, as both of you had reviewed the original PR that this one references; would one of you be able to look at this follow-up? |
serhiy-storchaka
left a comment
There was a problem hiding this comment.
The problem is that it makes all parameters optional. ExtensionFileLoader() is now valid.
I'm not familiar enough with the environment, but would that be an issue? It's not ideal but I currently see Alternatively, we could raise a Something like this: def __init__(self, fullname=None, path=None, *, name=None):
if name is not None:
_warnings.warn("the 'name' parameter is deprecated; use "
"'fullname' instead", DeprecationWarning,
stacklevel=2)
if fullname is not None:
raise TypeError("'name' and 'fullname' cannot be used "
"simultaneously")
self.name = name
elif fullname is not None:
self.name = fullname
else:
raise TypeError("'fullname' cannot be empty")
self.path = pathThere are two caveats that immediately come to mind. The first is that would With that being said if it doesn't break anything I'm still leaning towards allowing |
|
I actually just closed the issue and all other PRs due to too much time having passed since I opened the original issue back in 2017. The risk of breaking code is too high now just to get some purity around name consistency. @achhina thanks so much for taking a stab at this! But I'm afraid that I don't think we can take the PR. |
Corresponds to issue GH-74460. Fixed merge conflicts in PR-1735 as it has been reviewed successfully but has now been stale for over two years; thanks to @sayanchowdhury for the original code.