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

2021-07-17 Thread Mauricio Villegas
Mauricio Villegas 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

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

2021-07-17 Thread Mauricio Villegas
Mauricio Villegas added the comment: Also happens in python 3.10. === Python 3.10.0b4 === (*args, **kwargs) (self, /, *args, **kwargs) Traceback (most recent call last): ... ValueError: no signature found for builtin type -- versions: +Python 3.10

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

2021-07-16 Thread hongweipeng
Change by hongweipeng : -- keywords: +patch nosy: +hongweipeng nosy_count: 2.0 -> 3.0 pull_requests: +25721 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27177 ___ Python tracker

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

2021-07-14 Thread Guido van Rossum
Guido van Rossum added the comment: You're right, it seems specific to built-in *classes* like those in datetime. We get the same with inspect.signature(int), since int is also a built-in class. I don't know who maintains inspect, but it's not me. :-( --

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

2021-07-14 Thread Mauricio Villegas
Mauricio Villegas added the comment: > Doesn’t it do that with any built in function? Sorry. I did not include what is the behavior for other classes. An example could be calendar.Calendar. In this case the signature gives: >>> from calendar import Calendar >>> import inspect >>>

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

2021-07-14 Thread Guido van Rossum
Guido van Rossum added the comment: Doesn’t it do that with any built in function? Try Len or open, for example. I think that’s a feature, at least not a bug specific to date time. -- nosy: +gvanrossum ___ Python tracker

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

2021-07-13 Thread Mauricio Villegas
Change by Mauricio Villegas : -- components: +Library (Lib) type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing

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

2021-07-13 Thread Mauricio Villegas
New submission from Mauricio Villegas : Classes in the datetime module are implemented using __new__ with some named parameters. I want to be able to inspect their signature to know which are the names of the parameters it accepts like it works for most classes. However, this does not work