summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lbup/_path.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/lbup/_path.py b/lbup/_path.py
index 49cdec5..c21a59c 100644
--- a/lbup/_path.py
+++ b/lbup/_path.py
@@ -38,6 +38,15 @@ class AbsPath:
def __len__(self):
return len(self.components)
+ def __add__(self, other):
+ if isinstance(other, str):
+ other = other.encode('utf-8')
+
+ if isinstance(other, bytes):
+ other = self.__class__(b'/' + other)
+
+ return self.__class__(components = self.components + other.components)
+
@property
def path(self):
return b'/' + b'/'.join(self.components)