Ejemplo n.º 1
0
 def infer(self):
     for result_context in self._class_member_name.infer():
         if isinstance(result_context, FunctionContext):
             # Classes are never used to resolve anything within the
             # functions. Only other functions and modules will resolve
             # those things.
             yield BoundMethod(self._instance, self.class_context, result_context)
         else:
             for c in apply_py__get__(result_context, self._instance):
                 yield c
Ejemplo n.º 2
0
 def infer(self):
     for result_context in self._class_member_name.infer():
         if isinstance(result_context, FunctionContext):
             # Classes are never used to resolve anything within the
             # functions. Only other functions and modules will resolve
             # those things.
             yield BoundMethod(self._instance, self.class_context,
                               result_context)
         else:
             for c in apply_py__get__(result_context, self._instance):
                 yield c
Ejemplo n.º 3
0
    def infer(self):
        for result_context in super(LazyInstanceClassName, self).infer():
            if isinstance(result_context, FunctionContext):
                # Classes are never used to resolve anything within the
                # functions. Only other functions and modules will resolve
                # those things.
                parent_context = result_context.parent_context
                while parent_context.is_class():
                    parent_context = parent_context.parent_context

                yield BoundMethod(result_context.evaluator, self._instance,
                                  self.class_context, parent_context,
                                  result_context.tree_node)
            else:
                for c in apply_py__get__(result_context, self._instance):
                    yield c
Ejemplo n.º 4
0
    def infer(self):
        for result_context in super(LazyInstanceClassName, self).infer():
            if isinstance(result_context, FunctionContext):
                # Classes are never used to resolve anything within the
                # functions. Only other functions and modules will resolve
                # those things.
                parent_context = result_context.parent_context
                while parent_context.is_class():
                    parent_context = parent_context.parent_context

                yield BoundMethod(
                    result_context.evaluator, self._instance, self.class_context,
                    parent_context, result_context.tree_node
                )
            else:
                for c in apply_py__get__(result_context, self._instance):
                    yield c
Ejemplo n.º 5
0
 def infer(self):
     for result_context in self._class_member_name.infer():
         for c in apply_py__get__(result_context, self._instance, self.class_context):
             yield c