pySim.filesystem: Add __len__ method to Path object

This returns the length of the path.

Change-Id: I5e3ba726ed180405c4218ebeee240a3a40527f99
This commit is contained in:
Harald Welte
2024-08-02 20:49:53 +02:00
parent 19328e3bbd
commit 46bc37fa65

View File

@@ -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