mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-10 07:41:51 +08:00
list(open().read()) should work now, fixes #412.
This commit is contained in:
@@ -100,8 +100,10 @@ def _faked(module, obj, name):
|
|||||||
def get_faked(module, obj, name=None):
|
def get_faked(module, obj, name=None):
|
||||||
obj = obj.__class__ if is_class_instance(obj) else obj
|
obj = obj.__class__ if is_class_instance(obj) else obj
|
||||||
result = _faked(module, obj, name)
|
result = _faked(module, obj, name)
|
||||||
# TODO may this ever happen? result None? if so, document!
|
if result is None or isinstance(result, pt.Class):
|
||||||
if not isinstance(result, pt.Class) and result is not None:
|
# We're not interested in classes. What we want is functions.
|
||||||
|
return None
|
||||||
|
else:
|
||||||
# Set the docstr which was previously not set (faked modules don't
|
# Set the docstr which was previously not set (faked modules don't
|
||||||
# contain it).
|
# contain it).
|
||||||
doc = '"""%s"""' % obj.__doc__ # TODO need escapes.
|
doc = '"""%s"""' % obj.__doc__ # TODO need escapes.
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
class TextIOWrapper():
|
class TextIOWrapper():
|
||||||
def __next__(self):
|
def __next__(self):
|
||||||
return 'hacked io return'
|
return str()
|
||||||
|
|
||||||
|
def __iter__(self):
|
||||||
|
yield str()
|
||||||
|
|||||||
@@ -143,6 +143,9 @@ ret()[0]
|
|||||||
with open('') as f:
|
with open('') as f:
|
||||||
#? ['closed']
|
#? ['closed']
|
||||||
f.closed
|
f.closed
|
||||||
|
for line in f:
|
||||||
|
#? str()
|
||||||
|
line
|
||||||
|
|
||||||
with open('') as f1, open('') as f2:
|
with open('') as f1, open('') as f2:
|
||||||
#? ['closed']
|
#? ['closed']
|
||||||
|
|||||||
Reference in New Issue
Block a user