We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3054693 + 3b3cd60 commit 1233840Copy full SHA for 1233840
examples/units/basic_units.py
@@ -154,6 +154,9 @@ def __str__(self):
154
def __len__(self):
155
return len(self.value)
156
157
+ def __getitem__(self, key):
158
+ return TaggedValue(self.value[key], self.unit)
159
+
160
def __iter__(self):
161
# Return a generator expression rather than use `yield`, so that
162
# TypeError is raised by iter(self) if appropriate when checking for
0 commit comments