From 3b3cd60c9f97aba5e7d75bf7e26df15600bdd08c Mon Sep 17 00:00:00 2001 From: David Stansby Date: Mon, 1 Feb 2021 13:17:39 +0000 Subject: [PATCH] Make TaggedValue in basic_units a sequence --- examples/units/basic_units.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/units/basic_units.py b/examples/units/basic_units.py index 2a8e94887e95..0e62db1233e6 100644 --- a/examples/units/basic_units.py +++ b/examples/units/basic_units.py @@ -154,6 +154,9 @@ def __str__(self): def __len__(self): return len(self.value) + def __getitem__(self, key): + return TaggedValue(self.value[key], self.unit) + def __iter__(self): # Return a generator expression rather than use `yield`, so that # TypeError is raised by iter(self) if appropriate when checking for pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy