Exemplo n.º 1
0
 def py__getitem__(self, index_value_set, contextualized_node):
     return ValueSet(
         self.index_class.create_cached(
             self.inference_state,
             self.parent_context,
             self._tree_name,
             generics_manager=LazyGenericManager(
                 context_of_index=contextualized_node.context,
                 index_value=index_value,
             )) for index_value in index_value_set)
Exemplo n.º 2
0
 def py__getitem__(self, index_value_set, contextualized_node):
     from jedi.inference.gradual.base import GenericClass
     if not index_value_set:
         return ValueSet([self])
     return ValueSet(
         GenericClass(
             self,
             LazyGenericManager(
                 context_of_index=contextualized_node.context,
                 index_value=index_value,
             )) for index_value in index_value_set)
Exemplo n.º 3
0
 def py__getitem__(self, index_value_set, contextualized_node):
     from jedi.inference.gradual.base import GenericClass
     if not index_value_set:
         debug.warning(
             'Class indexes inferred to nothing. Returning class instead')
         return ValueSet([self])
     return ValueSet(
         GenericClass(
             self,
             LazyGenericManager(
                 context_of_index=contextualized_node.context,
                 index_value=index_value,
             )) for index_value in index_value_set)