File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,14 @@ Functions
77
77
# type: ( int , float ) -> float
78
78
return num1 + my_float
79
79
80
+ # An argument can be declared positional-only by giving it a name
81
+ # starting with two underscores:
82
+ def quux (__x ):
83
+ # type: ( int ) -> None
84
+ pass
85
+ quux(3 ) # Fine
86
+ quux(__x = 3 ) # Error
87
+
80
88
# This is how you annotate a function value.
81
89
x = f # type: Callable [[ int , float ], float ]
82
90
Original file line number Diff line number Diff line change @@ -73,6 +73,13 @@ Python 3 introduces an annotation syntax for function declarations in `PEP 3107
73
73
def f (num1 : int , my_float : float = 3.5 ) -> float :
74
74
return num1 + my_float
75
75
76
+ # An argument can be declared positional-only by giving it a name
77
+ # starting with two underscores:
78
+ def quux (__x : int ) -> None :
79
+ pass
80
+ quux(3 ) # Fine
81
+ quux(__x = 3 ) # Error
82
+
76
83
# This is how you annotate a function value.
77
84
x = f # type: Callable [[ int , float ], float ]
78
85
You can’t perform that action at this time.
0 commit comments