mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Merge branch 'master' into python3
This commit is contained in:
@@ -290,3 +290,22 @@ def test_in_brackets():
|
||||
x = yield from [1]
|
||||
#? None
|
||||
x
|
||||
|
||||
|
||||
# -----------------
|
||||
# Annotations
|
||||
# -----------------
|
||||
|
||||
from typing import Iterator
|
||||
|
||||
def annotation1() -> float:
|
||||
yield 1
|
||||
|
||||
def annotation2() -> Iterator[float]:
|
||||
yield 1
|
||||
|
||||
|
||||
#?
|
||||
next(annotation1())
|
||||
#? float()
|
||||
next(annotation2())
|
||||
|
||||
@@ -212,11 +212,33 @@ z.read('name').upper
|
||||
# contextlib
|
||||
# -----------------
|
||||
|
||||
from typing import Iterator
|
||||
import contextlib
|
||||
with contextlib.closing('asd') as string:
|
||||
#? str()
|
||||
string
|
||||
|
||||
@contextlib.contextmanager
|
||||
def cm1() -> Iterator[float]:
|
||||
yield 1
|
||||
with cm1() as x:
|
||||
#? float()
|
||||
x
|
||||
|
||||
@contextlib.contextmanager
|
||||
def cm2() -> float:
|
||||
yield 1
|
||||
with cm2() as x:
|
||||
#?
|
||||
x
|
||||
|
||||
@contextlib.contextmanager
|
||||
def cm3():
|
||||
yield 3
|
||||
with cm3() as x:
|
||||
#? int()
|
||||
x
|
||||
|
||||
# -----------------
|
||||
# operator
|
||||
# -----------------
|
||||
|
||||
Reference in New Issue
Block a user