MCPcopy Create free account
hub / github.com/s3tools/s3cmd / __getitem__

Method __getitem__

S3/SortedDict.py:71–79  ·  view source on GitHub ↗

Override to support the "get_slice" for python3

(self, index)

Source from the content-addressed store, hash-verified

69 return SortedDictIterator(self, self.keys(), reverse=True)
70
71 def __getitem__(self, index):
72 """Override to support the "get_slice" for python3 """
73 if isinstance(index, slice):
74 r = SortedDict(ignore_case = self.ignore_case)
75 for k in self.keys()[index]:
76 r[k] = self[k]
77 else:
78 r = super(SortedDict, self).__getitem__(index)
79 return r
80
81
82if __name__ == "__main__":

Callers

nothing calls this directly

Calls 2

keysMethod · 0.95
SortedDictClass · 0.85

Tested by

no test coverage detected