mirror of
https://github.com/davidhalter/jedi.git
synced 2026-10-08 03:34:35 +08:00
typing.Union and typing.Optional
This commit is contained in:
1 parent
7b97312509
commit
3852431549
2 files changed
+34
No files matched your search
@@ -154,5 +154,32 @@ def mapping(
|
||||
##? Value() --- TODO fix support for tuple assignment
|
||||
value
|
||||
|
||||
def union(
|
||||
p: typing.Union[int],
|
||||
q: typing.Union[int, int],
|
||||
r: typing.Union[int, str, "int"],
|
||||
s: typing.Union[int, typing.Union[str, "typing.Union['float', 'dict']"]],
|
||||
t: typing.Union[int, None]):
|
||||
#? int()
|
||||
p
|
||||
#? int()
|
||||
q
|
||||
#? int() str()
|
||||
r
|
||||
#? int() str() float() dict()
|
||||
s
|
||||
#? int()
|
||||
t
|
||||
|
||||
def optional(
|
||||
p: typing.Optional[int]):
|
||||
"""
|
||||
Optional does not do anything special. However it should be recognised
|
||||
as being of that type. Jedi doesn't do anything with the extra into that
|
||||
it can be None as well
|
||||
"""
|
||||
#? int()
|
||||
p
|
||||
|
||||
class ForwardReference:
|
||||
pass
|
||||
Reference in new issue
Block a user