summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2018-09-09 13:39:46 +0100
committerMaxime “pep” Buquet <pep@bouah.net>2018-09-09 13:39:46 +0100
commitbb9bc80d9b41acef30338943e5d27182fa0e75e6 (patch)
treedd1d1efcebe5e40ccc7241a07955e9e2e03c206f
parent2a755897476a382dedee9f34debc6f64005f46cb (diff)
downloadpoezio-bb9bc80d9b41acef30338943e5d27182fa0e75e6.tar.gz
poezio-bb9bc80d9b41acef30338943e5d27182fa0e75e6.tar.bz2
poezio-bb9bc80d9b41acef30338943e5d27182fa0e75e6.tar.xz
poezio-bb9bc80d9b41acef30338943e5d27182fa0e75e6.zip
Allow Tabs object to be sliced
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--poezio/core/tabs.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/poezio/core/tabs.py b/poezio/core/tabs.py
index bcf6dd41..3ced7a7e 100644
--- a/poezio/core/tabs.py
+++ b/poezio/core/tabs.py
@@ -67,10 +67,10 @@ class Tabs:
def __iter__(self):
return iter(self._tabs)
- def __getitem__(self, index: Union[int, str]):
- if isinstance(index, int):
- return self._tabs[index]
- return self.by_name(index)
+ def __getitem__(self, index: Union[int, str, slice]):
+ if isinstance(index, str):
+ return self.by_name(index)
+ return self._tabs[index]
def first(self) -> tabs.Tab:
"""Return the Roster tab"""