Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename arguments on _EditableFinder and _EditableNamespaceFinder #4470

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

mtreglia-gpsw
Copy link
Contributor

This commit rename the find_spec arguments in _EditableFinder and _EditableNamespaceFinder to be compliant of the standard importlib.abc.MetaPathFinder interface.

https://docs.python.org/3/library/importlib.html#importlib.machinery.PathFinder.find_spec https://github.com/abravalheri/typeshed/blob/eecac02ef7fdbe82b9dc57fa3ca4bb9d341116d7/stdlib/_typeshed/importlib.pyi

The find_module arguments were not renamed because the method find_module is deprecated starting from Pyhton3.10 and has been removed in Pyhton3.12

https://docs.python.org/3/reference/import.html#the-meta-path

Summary of changes

Closes

Pull Request Checklist

@abravalheri
Copy link
Contributor

Thank you very much @mtreglia-gpsw .

I don't know how this is handled in other libraries or if there is a convention for preferring del, but I would normally add the specific type ignore comment instead...

Anyway, I guess that is a matter of preference.

@mtreglia-gpsw
Copy link
Contributor Author

mtreglia-gpsw commented Jul 11, 2024

Thank you very much @mtreglia-gpsw .

I don't know how this is handled in other libraries or if there is a convention for preferring del, but I would normally add the specific type ignore comment instead...

Anyway, I guess that is a matter of preference.

Thank you @abravalheri,
Indeed with the del is not required the #type-ignore.
The del will just immediately decrement the ref counter for the variable instead of doing it when out of scope.

It's a matter of preference, If conventionally you prefer the type-ignore I will change it.

This commit rename the `find_spec` arguments in _EditableFinder and
_EditableNamespaceFinder to be compliant of the standard
`importlib.abc.MetaPathFinder` interface.

https://docs.python.org/3/library/importlib.html#importlib.machinery.PathFinder.find_spec
https://github.com/abravalheri/typeshed/blob/eecac02ef7fdbe82b9dc57fa3ca4bb9d341116d7/stdlib/_typeshed/importlib.pyi

The `find_module` arguments were not renamed because the method `find_module`
is deprecated starting from Pyhton3.10 and has been removed in Pyhton3.12

https://docs.python.org/3/reference/import.html#the-meta-path
@abravalheri abravalheri merged commit e304e4d into pypa:main Jul 11, 2024
22 checks passed
@abravalheri
Copy link
Contributor

Thank you.

@mtreglia-gpsw mtreglia-gpsw deleted the rename-args-EditableFinder branch July 12, 2024 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants