File: positional_only_params.py

package info (click to toggle)
python-jedi 0.19.1%2Bds1-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,680 kB
  • sloc: python: 28,783; makefile: 172; ansic: 13
file content (35 lines) | stat: -rw-r--r-- 598 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# python >= 3.8

def positional_only_call(a, /, b):
    #? str()
    a
    #? int()
    b
    if UNDEFINED:
        return a
    else:
        return b


#? int() str()
positional_only_call('', 1)


def positional_only_call2(a, /, b=3):
    if UNDEFINED:
        return a
    else:
        return 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)