From 46bc37fa65056ad1246d466ee773b67ca7c5f0f5 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 2 Aug 2024 20:49:53 +0200 Subject: [PATCH] pySim.filesystem: Add __len__ method to Path object This returns the length of the path. Change-Id: I5e3ba726ed180405c4218ebeee240a3a40527f99 --- pySim/filesystem.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pySim/filesystem.py b/pySim/filesystem.py index 0c7d51d7..2151c212 100644 --- a/pySim/filesystem.py +++ b/pySim/filesystem.py @@ -1471,6 +1471,9 @@ class Path: def __getitem__(self, i): return self.list[i] + def __len__(self): + return len(self.list) + def __add__(self, a): if isinstance(a, list): l = self.list + a