mirror of
https://github.com/davidhalter/jedi.git
synced 2026-10-28 19:53:17 +08:00
Fix issues with generators, fixes #1624
This commit is contained in:
1 parent
d1851c369c
commit
e4987b3e7a
4 files changed
+60
-11
No files matched your search
@@ -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