[New-bugs-announce] [issue44893] importlib.metadata Entrypoint has a broken _asdict
Ronny Pfannschmidt
report at bugs.python.org
Wed Aug 11 17:33:03 EDT 2021
New submission from Ronny Pfannschmidt <bugs.python.org at ronnypfannschmidt.de>:
due to
```
def __iter__(self):
"""
Supply iter so one may construct dicts of EntryPoints easily.
"""
return iter((self.name, self))
```
the default namedtuple asdict method is broken
instead of returning the fields, recursive objects are returned as
```
(Pdb) v
EntryPoint(name='.git', value='setuptools_scm.git:parse', group='setuptools_scm.parse_scm')
(Pdb) v._asdict()
{'name': '.git', 'value': EntryPoint(name='.git', value='setuptools_scm.git:parse', group='setuptools_scm.parse_scm')}
(Pdb) type(v)
<class 'importlib.metadata.EntryPoint'>
(Pdb)
----------
components: Library (Lib)
messages: 399419
nosy: Ronny.Pfannschmidt
priority: normal
severity: normal
status: open
title: importlib.metadata Entrypoint has a broken _asdict
type: behavior
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44893>
_______________________________________
More information about the New-bugs-announce
mailing list