-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Entrypoint __iter__ implemementation breaks _asdict #337
Comments
Also bpo-44893. |
In #338, I've drafted a fix, but before I merge the change, I'm pondering - does this project want to support the requested interface. I agree that it's reasonable to expect a I originally made I've only learned in the past couple of years how dangerous it is to use a built-in type because it implements a subset of the features needed. In a formal API such as Before embarking on supporting the requested behavior, I think it's worthwhile stepping back to ask - what is this functionality needed for? Other approaches I'd like to consider:
Why should this project care about supporting |
its a easy way to debug/trace details for namedtuples (where vars won't work) in my own code i migrated to always use fields/getattr to wokr around the bug i took note of the issue when it created a endless recursion in a debug helper its not clear to me what most reasonable way to express a entrypoint would be, imho it violates multiple python principles just to provide convenience, |
That I can agree, and that behavior is deprecated and slated for removal.
Thanks for clarifying. That doesn't strike me as a particularly compelling reason to keep this particular interface and more a reason to get rid of the qwirky In #339, I lay out the implementation I have in mind. Basically, eschew namedtuple and instead store keyword-only attributes on the object. The |
v4.8.1 #348: Restored support for EntryPoint access by item, deprecating support in the process. Users are advised to use direct member access instead of item-based access: - ep[0] -> ep.name - ep[1] -> ep.value - ep[2] -> ep.group - ep[:] -> ep.name, ep.value, ep.group v4.8.0 #337: Rewrote EntryPoint as a simple class, still immutable and still with the attributes, but without any expectation for namedtuple functionality such as _asdict. v4.7.1 #344: Fixed regression in packages_distributions when neither top-level.txt nor a files manifest is present. v4.7.0 #330: In packages_distributions, now infer top-level names from .files() when a top-level.txt (Setuptools-specific metadata) is not present. References: python/importlib_metadata#348 python/importlib_metadata#337 python/importlib_metadata#344 python/importlib_metadata#330 Signed-off-by: Tim Orling <timothy.t.orling@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
v4.8.1 #348: Restored support for EntryPoint access by item, deprecating support in the process. Users are advised to use direct member access instead of item-based access: - ep[0] -> ep.name - ep[1] -> ep.value - ep[2] -> ep.group - ep[:] -> ep.name, ep.value, ep.group v4.8.0 #337: Rewrote EntryPoint as a simple class, still immutable and still with the attributes, but without any expectation for namedtuple functionality such as _asdict. v4.7.1 #344: Fixed regression in packages_distributions when neither top-level.txt nor a files manifest is present. v4.7.0 #330: In packages_distributions, now infer top-level names from .files() when a top-level.txt (Setuptools-specific metadata) is not present. References: python/importlib_metadata#348 python/importlib_metadata#337 python/importlib_metadata#344 python/importlib_metadata#330 (From OE-Core rev: 01eb9d4384ae78b02780cea3b8690d99484b2602) Signed-off-by: Tim Orling <timothy.t.orling@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
v4.8.1 #348: Restored support for EntryPoint access by item, deprecating support in the process. Users are advised to use direct member access instead of item-based access: - ep[0] -> ep.name - ep[1] -> ep.value - ep[2] -> ep.group - ep[:] -> ep.name, ep.value, ep.group v4.8.0 #337: Rewrote EntryPoint as a simple class, still immutable and still with the attributes, but without any expectation for namedtuple functionality such as _asdict. v4.7.1 #344: Fixed regression in packages_distributions when neither top-level.txt nor a files manifest is present. v4.7.0 #330: In packages_distributions, now infer top-level names from .files() when a top-level.txt (Setuptools-specific metadata) is not present. References: python/importlib_metadata#348 python/importlib_metadata#337 python/importlib_metadata#344 python/importlib_metadata#330 (From OE-Core rev: 01eb9d4384ae78b02780cea3b8690d99484b2602) Signed-off-by: Tim Orling <timothy.t.orling@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
v4.8.1 #348: Restored support for EntryPoint access by item, deprecating support in the process. Users are advised to use direct member access instead of item-based access: - ep[0] -> ep.name - ep[1] -> ep.value - ep[2] -> ep.group - ep[:] -> ep.name, ep.value, ep.group v4.8.0 #337: Rewrote EntryPoint as a simple class, still immutable and still with the attributes, but without any expectation for namedtuple functionality such as _asdict. v4.7.1 #344: Fixed regression in packages_distributions when neither top-level.txt nor a files manifest is present. v4.7.0 #330: In packages_distributions, now infer top-level names from .files() when a top-level.txt (Setuptools-specific metadata) is not present. References: python/importlib_metadata#348 python/importlib_metadata#337 python/importlib_metadata#344 python/importlib_metadata#330 (From OE-Core rev: 01eb9d4384ae78b02780cea3b8690d99484b2602) Signed-off-by: Tim Orling <timothy.t.orling@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
v4.8.1 #348: Restored support for EntryPoint access by item, deprecating support in the process. Users are advised to use direct member access instead of item-based access: - ep[0] -> ep.name - ep[1] -> ep.value - ep[2] -> ep.group - ep[:] -> ep.name, ep.value, ep.group v4.8.0 #337: Rewrote EntryPoint as a simple class, still immutable and still with the attributes, but without any expectation for namedtuple functionality such as _asdict. v4.7.1 #344: Fixed regression in packages_distributions when neither top-level.txt nor a files manifest is present. v4.7.0 #330: In packages_distributions, now infer top-level names from .files() when a top-level.txt (Setuptools-specific metadata) is not present. References: python/importlib_metadata#348 python/importlib_metadata#337 python/importlib_metadata#344 python/importlib_metadata#330 (From OE-Core rev: 01eb9d4384ae78b02780cea3b8690d99484b2602) Signed-off-by: Tim Orling <timothy.t.orling@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
v4.8.1 #348: Restored support for EntryPoint access by item, deprecating support in the process. Users are advised to use direct member access instead of item-based access: - ep[0] -> ep.name - ep[1] -> ep.value - ep[2] -> ep.group - ep[:] -> ep.name, ep.value, ep.group v4.8.0 #337: Rewrote EntryPoint as a simple class, still immutable and still with the attributes, but without any expectation for namedtuple functionality such as _asdict. v4.7.1 #344: Fixed regression in packages_distributions when neither top-level.txt nor a files manifest is present. v4.7.0 #330: In packages_distributions, now infer top-level names from .files() when a top-level.txt (Setuptools-specific metadata) is not present. References: python/importlib_metadata#348 python/importlib_metadata#337 python/importlib_metadata#344 python/importlib_metadata#330 (From OE-Core rev: 01eb9d4384ae78b02780cea3b8690d99484b2602) Signed-off-by: Tim Orling <timothy.t.orling@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
v4.8.1 #348: Restored support for EntryPoint access by item, deprecating support in the process. Users are advised to use direct member access instead of item-based access: - ep[0] -> ep.name - ep[1] -> ep.value - ep[2] -> ep.group - ep[:] -> ep.name, ep.value, ep.group v4.8.0 #337: Rewrote EntryPoint as a simple class, still immutable and still with the attributes, but without any expectation for namedtuple functionality such as _asdict. v4.7.1 #344: Fixed regression in packages_distributions when neither top-level.txt nor a files manifest is present. v4.7.0 #330: In packages_distributions, now infer top-level names from .files() when a top-level.txt (Setuptools-specific metadata) is not present. References: python/importlib_metadata#348 python/importlib_metadata#337 python/importlib_metadata#344 python/importlib_metadata#330 (From OE-Core rev: 01eb9d4384ae78b02780cea3b8690d99484b2602) Signed-off-by: Tim Orling <timothy.t.orling@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
v4.8.1 #348: Restored support for EntryPoint access by item, deprecating support in the process. Users are advised to use direct member access instead of item-based access: - ep[0] -> ep.name - ep[1] -> ep.value - ep[2] -> ep.group - ep[:] -> ep.name, ep.value, ep.group v4.8.0 #337: Rewrote EntryPoint as a simple class, still immutable and still with the attributes, but without any expectation for namedtuple functionality such as _asdict. v4.7.1 #344: Fixed regression in packages_distributions when neither top-level.txt nor a files manifest is present. v4.7.0 #330: In packages_distributions, now infer top-level names from .files() when a top-level.txt (Setuptools-specific metadata) is not present. References: python/importlib_metadata#348 python/importlib_metadata#337 python/importlib_metadata#344 python/importlib_metadata#330 (From OE-Core rev: 4272ca45d137b91ec368c94b3e0dbd7d56c616dd) Signed-off-by: Tim Orling <timothy.t.orling@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
v4.8.1 #348: Restored support for EntryPoint access by item, deprecating support in the process. Users are advised to use direct member access instead of item-based access: - ep[0] -> ep.name - ep[1] -> ep.value - ep[2] -> ep.group - ep[:] -> ep.name, ep.value, ep.group v4.8.0 #337: Rewrote EntryPoint as a simple class, still immutable and still with the attributes, but without any expectation for namedtuple functionality such as _asdict. v4.7.1 #344: Fixed regression in packages_distributions when neither top-level.txt nor a files manifest is present. v4.7.0 #330: In packages_distributions, now infer top-level names from .files() when a top-level.txt (Setuptools-specific metadata) is not present. References: python/importlib_metadata#348 python/importlib_metadata#337 python/importlib_metadata#344 python/importlib_metadata#330 Signed-off-by: Tim Orling <timothy.t.orling@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
v4.8.1 #348: Restored support for EntryPoint access by item, deprecating support in the process. Users are advised to use direct member access instead of item-based access: - ep[0] -> ep.name - ep[1] -> ep.value - ep[2] -> ep.group - ep[:] -> ep.name, ep.value, ep.group v4.8.0 #337: Rewrote EntryPoint as a simple class, still immutable and still with the attributes, but without any expectation for namedtuple functionality such as _asdict. v4.7.1 #344: Fixed regression in packages_distributions when neither top-level.txt nor a files manifest is present. v4.7.0 #330: In packages_distributions, now infer top-level names from .files() when a top-level.txt (Setuptools-specific metadata) is not present. References: python/importlib_metadata#348 python/importlib_metadata#337 python/importlib_metadata#344 python/importlib_metadata#330 Signed-off-by: Tim Orling <timothy.t.orling@intel.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
v4.8.1 #348: Restored support for EntryPoint access by item, deprecating support in the process. Users are advised to use direct member access instead of item-based access: - ep[0] -> ep.name - ep[1] -> ep.value - ep[2] -> ep.group - ep[:] -> ep.name, ep.value, ep.group v4.8.0 #337: Rewrote EntryPoint as a simple class, still immutable and still with the attributes, but without any expectation for namedtuple functionality such as _asdict. v4.7.1 #344: Fixed regression in packages_distributions when neither top-level.txt nor a files manifest is present. v4.7.0 #330: In packages_distributions, now infer top-level names from .files() when a top-level.txt (Setuptools-specific metadata) is not present. References: python/importlib_metadata#348 python/importlib_metadata#337 python/importlib_metadata#344 python/importlib_metadata#330 (From OE-Core rev: 21d72ace8f9486bd1b478e28d53da64087d790fa) Signed-off-by: Tim Orling <timothy.t.orling@intel.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
v4.8.1 #348: Restored support for EntryPoint access by item, deprecating support in the process. Users are advised to use direct member access instead of item-based access: - ep[0] -> ep.name - ep[1] -> ep.value - ep[2] -> ep.group - ep[:] -> ep.name, ep.value, ep.group v4.8.0 #337: Rewrote EntryPoint as a simple class, still immutable and still with the attributes, but without any expectation for namedtuple functionality such as _asdict. v4.7.1 #344: Fixed regression in packages_distributions when neither top-level.txt nor a files manifest is present. v4.7.0 #330: In packages_distributions, now infer top-level names from .files() when a top-level.txt (Setuptools-specific metadata) is not present. References: python/importlib_metadata#348 python/importlib_metadata#337 python/importlib_metadata#344 python/importlib_metadata#330 (From OE-Core rev: 21d72ace8f9486bd1b478e28d53da64087d790fa) Signed-off-by: Tim Orling <timothy.t.orling@intel.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
v4.8.1 #348: Restored support for EntryPoint access by item, deprecating support in the process. Users are advised to use direct member access instead of item-based access: - ep[0] -> ep.name - ep[1] -> ep.value - ep[2] -> ep.group - ep[:] -> ep.name, ep.value, ep.group v4.8.0 #337: Rewrote EntryPoint as a simple class, still immutable and still with the attributes, but without any expectation for namedtuple functionality such as _asdict. v4.7.1 #344: Fixed regression in packages_distributions when neither top-level.txt nor a files manifest is present. v4.7.0 #330: In packages_distributions, now infer top-level names from .files() when a top-level.txt (Setuptools-specific metadata) is not present. References: python/importlib_metadata#348 python/importlib_metadata#337 python/importlib_metadata#344 python/importlib_metadata#330 (From OE-Core rev: 21d72ace8f9486bd1b478e28d53da64087d790fa) Signed-off-by: Tim Orling <timothy.t.orling@intel.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
importlib_metadata/importlib_metadata/__init__.py
Lines 191 to 200 in 2678a5e
i was most surprised when my namedtuple debug printer turned into a endless recursion
The text was updated successfully, but these errors were encountered: