Callable[[Any * N], Any]: Trouble matching against constructors for certain built-in types #15
Labels
enhancement
Enhancement to existing feature
upstream
Requires fix in dependency, or dependency upgrade
Milestone
In the test suite's
test_callable_p_r
you will see lines like:We want all of those lines to all be
assertTryCastSuccess
(and still have the test pass).The failing lines above occur because an
inspect.Signature
cannot be generated for the constructor of certain built-in types:Based on reading the implementation of
inspect.signature()
and the underlying_signature_from_callable()
, it looks like the desired fix would be to define an__signature__
on the type itself. For example:Unfortunately as the ERROR above alludes, there's no way to set
__signature__
directly from normal Python code.Next steps:
inspect.signature(bool)
(and calls on similar built-in types) not workingThe text was updated successfully, but these errors were encountered: