argument: float) -> int</span>
</dt>
<dd>Scale an integer, kwargs</dd>
- <dt id="takes_a_function-b0069">
- <span class="m-doc-wrap-bumper">def <a href="#takes_a_function-b0069" class="m-doc-self">takes_a_function</a>(</span><span class="m-doc-wrap">arg0: Callable[[float, List[float]], int]<span class="m-text m-dim">, /</span>) -> None</span>
+ <dt id="takes_a_function-515df">
+ <span class="m-doc-wrap-bumper">def <a href="#takes_a_function-515df" class="m-doc-self">takes_a_function</a>(</span><span class="m-doc-wrap">arg0: typing.Callable[[float, typing.List[float]], int]<span class="m-text m-dim">, /</span>) -> None</span>
</dt>
<dd>A function taking a Callable</dd>
- <dt id="takes_a_function_returning_none-08451">
- <span class="m-doc-wrap-bumper">def <a href="#takes_a_function_returning_none-08451" class="m-doc-self">takes_a_function_returning_none</a>(</span><span class="m-doc-wrap">arg0: Callable[[], None]<span class="m-text m-dim">, /</span>) -> None</span>
+ <dt id="takes_a_function_returning_none-0a9eb">
+ <span class="m-doc-wrap-bumper">def <a href="#takes_a_function_returning_none-0a9eb" class="m-doc-self">takes_a_function_returning_none</a>(</span><span class="m-doc-wrap">arg0: typing.Callable[[], None]<span class="m-text m-dim">, /</span>) -> None</span>
</dt>
<dd>A function taking a Callable that returns None</dd>
- <dt id="taking_a_list_returning_a_tuple-54d79">
- <span class="m-doc-wrap-bumper">def <a href="#taking_a_list_returning_a_tuple-54d79" class="m-doc-self">taking_a_list_returning_a_tuple</a>(</span><span class="m-doc-wrap">arg0: List[float]<span class="m-text m-dim">, /</span>) -> Tuple[int, int, int]</span>
+ <dt id="taking_a_list_returning_a_tuple-11ba6">
+ <span class="m-doc-wrap-bumper">def <a href="#taking_a_list_returning_a_tuple-11ba6" class="m-doc-self">taking_a_list_returning_a_tuple</a>(</span><span class="m-doc-wrap">arg0: typing.List[float]<span class="m-text m-dim">, /</span>) -> typing.Tuple[int, int, int]</span>
</dt>
<dd>Takes a list, returns a tuple</dd>
<dt id="tenOverloads-fe11a">
'thingy(self, the_other_thing: Callable[[], None])'),
('thingy', '', [
('self', None, None, None),
- ('the_other_thing', 'Callable[[], None]', 'Callable[[], None]', None),
+ ('the_other_thing', 'typing.Callable[[], None]', 'typing.Callable[[], None]', None),
], None))
def test_square_brackets(self):
self.assertEqual(parse_pybind_signature(self.state, [],
'foo(a: Tuple[int, str], no_really: str) -> List[str]'),
('foo', '', [
- ('a', 'Tuple[int, str]', 'Tuple[int, str]', None),
+ ('a', 'typing.Tuple[int, str]', 'typing.Tuple[int, str]', None),
('no_really', 'str', 'str', None),
- ], 'List[str]'))
+ ], 'typing.List[str]'))
def test_nested_square_brackets(self):
self.assertEqual(parse_pybind_signature(self.state, [],
- 'foo(a: Tuple[int, List[Tuple[int, int]]], another: float) -> Union[str, Any]'),
+ 'foo(a: Tuple[int, List[Tuple[int, int]]], another: float) -> Union[str, None]'),
('foo', '', [
- ('a', 'Tuple[int, List[Tuple[int, int]]]', 'Tuple[int, List[Tuple[int, int]]]', None),
+ ('a', 'typing.Tuple[int, typing.List[typing.Tuple[int, int]]]', 'typing.Tuple[int, typing.List[typing.Tuple[int, int]]]', None),
('another', 'float', 'float', None),
- ], 'Union[str, Any]'))
+ ], 'typing.Union[str, None]'))
def test_callable(self):
self.assertEqual(parse_pybind_signature(self.state, [],
'foo(a: Callable[[int, Tuple[int, int]], float], another: float)'),
('foo', '', [
- ('a', 'Callable[[int, Tuple[int, int]], float]', 'Callable[[int, Tuple[int, int]], float]', None),
+ ('a', 'typing.Callable[[int, typing.Tuple[int, int]], float]', 'typing.Callable[[int, typing.Tuple[int, int]], float]', None),
('another', 'float', 'float', None),
], None))
state.module_mapping['module._module'] = 'module'
self.assertEqual(parse_pybind_signature(state, [],
- 'foo(a: module._module.Foo, b: Tuple[int, module._module.Bar]) -> module._module.Baz'),
+ 'foo(a: module._module.Foo, b: typing.Tuple[int, module._module.Bar]) -> module._module.Baz'),
('foo', '', [('a', 'module.Foo', 'module.Foo', None),
- ('b', 'Tuple[int, module.Bar]', 'Tuple[int, module.Bar]', None)], 'module.Baz'))
+ ('b', 'typing.Tuple[int, module.Bar]', 'typing.Tuple[int, module.Bar]', None)], 'module.Baz'))
class Signatures(BaseInspectTestCase):
def test_positional_args(self):