Fix pow() signature, fixes #1357

This commit changes how params starting with __ are viewed as positional only params
This commit is contained in:
Dave Halter
2019-07-04 00:29:57 -07:00
parent abdb8de89d
commit 6b9b2836ba
2 changed files with 21 additions and 1 deletions

View File

@@ -50,3 +50,13 @@ def test_tree_signature(Script, environment, code, expected):
sig, = Script(code).call_signatures()
assert expected == sig._signature.to_string()
def test_pow_signature(Script):
# See github #1357
sigs = Script('pow(').call_signatures()
strings = {sig._signature.to_string() for sig in sigs}
assert strings == {'pow(x: float, y: float, z: float, /) -> float',
'pow(x: float, y: float, /) -> float',
'pow(x: int, y: int, z: int, /) -> Any',
'pow(x: int, y: int, /) -> Any'}