mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 05:54:25 +08:00
Add tests for positional only params
This commit is contained in:
29
test/completion/positional_only_params.py
Normal file
29
test/completion/positional_only_params.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# python >= 3.8
|
||||
|
||||
def positional_only_call(a, /, b):
|
||||
#? str()
|
||||
a
|
||||
#? int()
|
||||
b
|
||||
return a + b
|
||||
|
||||
|
||||
#? int() str()
|
||||
positional_only_call('', 1)
|
||||
|
||||
|
||||
def positional_only_call2(a, /, b=3):
|
||||
return a + b
|
||||
|
||||
#? int()
|
||||
positional_only_call2(1)
|
||||
#? int()
|
||||
positional_only_call2(SOMETHING_UNDEFINED)
|
||||
#? str()
|
||||
positional_only_call2(SOMETHING_UNDEFINED, '')
|
||||
|
||||
# Maybe change this? Because it's actually not correct
|
||||
#? int() str()
|
||||
positional_only_call2(a=1, b='')
|
||||
#? tuple str()
|
||||
positional_only_call2(b='', a=tuple)
|
||||
Reference in New Issue
Block a user