MCPcopy Index your code
hub / github.com/python/cpython / __convert_to_ast_getitem

Method __convert_to_ast_getitem

Lib/annotationlib.py:404–422  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

402 return ast.Name(id=name), {name: other}
403
404 def __convert_to_ast_getitem(self, other):
405 if isinstance(other, slice):
406 extra_names = {}
407
408 def conv(obj):
409 if obj is None:
410 return None
411 new_obj, new_extra_names = self.__convert_to_ast(obj)
412 if new_extra_names is not None:
413 extra_names.update(new_extra_names)
414 return new_obj
415
416 return ast.Slice(
417 lower=conv(other.start),
418 upper=conv(other.stop),
419 step=conv(other.step),
420 ), extra_names
421 else:
422 return self.__convert_to_ast(other)
423
424 def __get_ast(self):
425 node = self.__ast_node__

Callers 1

__getitem__Method · 0.95

Calls 2

__convert_to_astMethod · 0.95
convFunction · 0.85

Tested by

no test coverage detected