Ejemplo n.º 1
0
 def _get_iter(self, _slice, key, get_if_not_present=False):
     if key.__class__ not in (tuple, list):
         key = (key, )
     return _IndexedComponent_slice_iter(
         _slice,
         _fill_in_known_wildcards(flatten_tuple(key),
                                  get_if_not_present=get_if_not_present))
Ejemplo n.º 2
0
 def _get_iter(self, _slice, key):
     if key.__class__ not in (tuple, list):
         key = (key, )
     return _IndexedComponent_slice_iter(_slice,
                                         _fill_in_known_wildcards(
                                             flatten_tuple(key),
                                             look_in_index=True),
                                         iter_over_index=True)
Ejemplo n.º 3
0
 def _get_iter(self, _slice, key, get_if_not_present=False):
     if key.__class__ not in (tuple, list):
         key = (key,)
     return _IndexedComponent_slice_iter(
         _slice,
         _fill_in_known_wildcards(flatten_tuple(key),
                                  get_if_not_present=get_if_not_present)
     )
Ejemplo n.º 4
0
 def _get_iter(self, _slice, key):
     if key.__class__ not in (tuple, list):
         key = (key,)
     return _IndexedComponent_slice_iter(
         _slice,
         _fill_in_known_wildcards(flatten_tuple(key), look_in_index=True),
         iter_over_index=True
     )
Ejemplo n.º 5
0
 def _get_iter(self, _slice, key, get_if_not_present=False):
     # Construct a slice iter with `_fill_in_known_wildcards`
     # as `advance_iter`. This reuses all the logic from the slice
     # iter to walk the call/iter stacks, but just jumps to a
     # particular component rather than actually iterating.
     # This is how this object does lookups.
     if key.__class__ not in (tuple, list):
         key = (key, )
     return _IndexedComponent_slice_iter(
         _slice,
         _fill_in_known_wildcards(flatten_tuple(key),
                                  get_if_not_present=get_if_not_present))