This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Support operator module callables in inspect.signature
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: plammens
Priority: normal Keywords:

Created on 2020-12-30 12:38 by plammens, last changed 2022-04-11 14:59 by admin.

Messages (2)
msg384061 - (view) Author: Paolo Lammens (plammens) * Date: 2020-12-30 12:38
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.
msg384062 - (view) Author: Paolo Lammens (plammens) * Date: 2020-12-30 12:39
Correction:

```
ValueError: callable operator.attrgetter('spam') is not supported by signature
```
History
Date User Action Args
2022-04-11 14:59:39adminsetgithub: 86951
2020-12-30 12:39:03plammenssetmessages: + msg384062
2020-12-30 12:38:08plammenscreate