mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-19 20:11:12 +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):
|
||||
obj = obj.__class__ if is_class_instance(obj) else obj
|
||||
result = _faked(module, obj, name)
|
||||
# TODO may this ever happen? result None? if so, document!
|
||||
if not isinstance(result, pt.Class) and result is not None:
|
||||
if result is None or isinstance(result, pt.Class):
|
||||
# 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
|
||||
# contain it).
|
||||
doc = '"""%s"""' % obj.__doc__ # TODO need escapes.
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
class TextIOWrapper():
|
||||
def __next__(self):
|
||||
return 'hacked io return'
|
||||
return str()
|
||||
|
||||
def __iter__(self):
|
||||
yield str()
|
||||
|
||||
@@ -143,6 +143,9 @@ ret()[0]
|
||||
with open('') as f:
|
||||
#? ['closed']
|
||||
f.closed
|
||||
for line in f:
|
||||
#? str()
|
||||
line
|
||||
|
||||
with open('') as f1, open('') as f2:
|
||||
#? ['closed']
|
||||
|
||||
Reference in New Issue
Block a user