-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathtest.py
More file actions
39 lines (24 loc) · 846 Bytes
/
test.py
File metadata and controls
39 lines (24 loc) · 846 Bytes
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
36
37
38
39
import typing
class OverloadedInit:
@typing.overload
def __init__(self, x: int) -> None: ...
@typing.overload
def __init__(self, x: str, y: str) -> None: ...
def __init__(self, x, y=None):
pass
OverloadedInit(1) # $ init=OverloadedInit.__init__:11
OverloadedInit("a", "b") # $ init=OverloadedInit.__init__:11
from typing import overload
class OverloadedInitFromImport:
@overload
def __init__(self, x: int) -> None: ...
@overload
def __init__(self, x: str, y: str) -> None: ...
def __init__(self, x, y=None):
pass
OverloadedInitFromImport(1) # $ init=OverloadedInitFromImport.__init__:28
OverloadedInitFromImport("a", "b") # $ init=OverloadedInitFromImport.__init__:28
class NoOverloads:
def __init__(self, x):
pass
NoOverloads(1) # $ init=NoOverloads.__init__:36