You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not an issue report, it is a question. Hopefully it is acceptable to ask it here, otherwise please redirect me to the appropriate venue...
In order to avoid the try-import-except-import dance, I am considering simply using this library for all Python versions that my project supports (Python 3.5 to 3.8, potentially 3.9), instead of importlib.metadata from the standard library where available. Is that an acceptable thing to do, any drawback one should be aware of?
On one side, one can read:
Users of Python 3.8 and beyond are encouraged to use the standard library module. When imported on Python 3.8 and later, importlib_metadata replaces the DistributionFinder behavior from the stdlib, but leaves the API in tact.
So I think you should check the importlib.metadata documentation and/or Python release notes and see if the feature you need is in the standard library or if you need to use this package which backports it.
Thanks FFY00. That's right, the approach is the same. At this time of writing, most of the functionality of importlib_metadata is in Python 3.8. Some recent features like dist attribute on entry points will only appear in later Pythons (probably 3.10).
In GitLab by @sinoroc on Sep 30, 2020, 10:00
This is not an issue report, it is a question. Hopefully it is acceptable to ask it here, otherwise please redirect me to the appropriate venue...
In order to avoid the try-import-except-import dance, I am considering simply using this library for all Python versions that my project supports (Python 3.5 to 3.8, potentially 3.9), instead of
importlib.metadata
from the standard library where available. Is that an acceptable thing to do, any drawback one should be aware of?On one side, one can read:
-- https://importlib-metadata.readthedocs.io/en/latest/
On the other:
-- https://docs.python.org/3/library/importlib.metadata.html
This is a bit confusing. What does that mean? What are more concretely the pros and cons of using one or the other?
Is there a way to know which version of
importlib-metadata
is in which version of Python (if that makes sense)?The text was updated successfully, but these errors were encountered: