mirror of
https://github.com/davidhalter/jedi.git
synced 2026-01-15 08:26:42 +08:00
__file__ should be listed as a module attribute.
This commit is contained in:
@@ -336,7 +336,7 @@ class LazyName(FakeName):
|
||||
|
||||
@parent.setter
|
||||
def parent(self, value):
|
||||
pass # Do nothing, lower level can try to set the parent.
|
||||
pass # Do nothing, super classes can try to set the parent.
|
||||
|
||||
|
||||
def stmts_to_stmt(statements):
|
||||
|
||||
@@ -71,7 +71,6 @@ class GeneratorMixin(object):
|
||||
return [self.iter_content()[index]]
|
||||
|
||||
|
||||
|
||||
class Generator(use_metaclass(CachedMetaClass, IterableWrapper, GeneratorMixin)):
|
||||
"""Handling of `yield` functions."""
|
||||
def __init__(self, evaluator, func, var_args):
|
||||
@@ -155,7 +154,6 @@ class ListComprehension(Comprehension):
|
||||
return self._evaluator.eval_element(self.eval_node())
|
||||
|
||||
|
||||
|
||||
class GeneratorComprehension(Comprehension, GeneratorMixin):
|
||||
def iter_content(self):
|
||||
return self._evaluator.eval_element(self.eval_node())
|
||||
|
||||
@@ -706,7 +706,7 @@ class ModuleWrapper(use_metaclass(CachedMetaClass, pr.Module, Wrapper)):
|
||||
@memoize_default()
|
||||
def _module_attributes(self):
|
||||
def parent_callback():
|
||||
return Instance(self._evaluator, compiled.create(self._evaluator, str))
|
||||
return self._evaluator.execute(compiled.create(self._evaluator, str))[0]
|
||||
|
||||
names = ['__file__', '__package__', '__doc__', '__name__', '__version__']
|
||||
# All the additional module attributes are strings.
|
||||
|
||||
Reference in New Issue
Block a user