[issue44618] inspect.signature does not work for datetime classes

Mauricio Villegas report at bugs.python.org
Sat Jul 17 05:51:41 EDT 2021


Mauricio Villegas <mauricio_ville at yahoo.com> added the comment:

I am not sure if this affects all built-in classes, assuming that by built-in it means that `SOMEOBJECT.__class__.__module__ == 'builtins'`. For example I have C++ library that is compiled into a python module using swig. It is available as a docker image `docker pull mauvilsa/pagexml:runtime-ubuntu20.04-py38`. For a class in that module it can be observed:

>>> import inspect
>>> import pagexml
>>> pagexml.swigPageXML.PageXML.__class__.__module__
'builtins'
>>> print(inspect.signature(pagexml.swigPageXML.PageXML.__init__))
(self, pagexml_path=None, schema_path=None)

----------

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


More information about the Python-bugs-list mailing list