mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
Fix issues with generators, fixes #1624
This commit is contained in:
@@ -253,12 +253,34 @@ z.read('name').upper
|
||||
# -----------------
|
||||
# contextlib
|
||||
# -----------------
|
||||
|
||||
# python > 2.7
|
||||
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