[New-bugs-announce] [issue42785] Support operator module callables in inspect.signature

Paolo Lammens report at bugs.python.org
Wed Dec 30 07:38:08 EST 2020


New submission from Paolo Lammens <lammenspaolo at gmail.com>:

Currently, `inspect.signature` doesn't support all callables from the `operator` module, e.g. `operator.attrgetter`:

```python
>>> import inspect
>>> import operator
>>> inspect.signature(operator.attrgetter("spam"))
ValueError: callable operator.attrgetter('is_host') is not supported by signature
```

Support for this could be added either directly to `inspect.signature` or by adding `__signature__` attributes to `operator`'s classes.

----------
components: Library (Lib)
messages: 384061
nosy: plammens
priority: normal
severity: normal
status: open
title: Support operator module callables in inspect.signature
type: enhancement
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42785>
_______________________________________


More information about the New-bugs-announce mailing list