Handle also longs in EncodedSize

This commit is contained in:
Petteri Aimonen
2013-10-24 08:44:59 +03:00
parent 51f0e47295
commit 0848255d4a

View File

@@ -105,7 +105,7 @@ class EncodedSize:
self.symbols = symbols self.symbols = symbols
def __add__(self, other): def __add__(self, other):
if isinstance(other, int): if isinstance(other, (int, long)):
return EncodedSize(self.value + other, self.symbols) return EncodedSize(self.value + other, self.symbols)
elif isinstance(other, (str, Names)): elif isinstance(other, (str, Names)):
return EncodedSize(self.value, self.symbols + [str(other)]) return EncodedSize(self.value, self.symbols + [str(other)])