Commit f526c64f authored by Yusei Tahara's avatar Yusei Tahara

Implement __len__, __getitem__, __getslice__.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23560 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d5c471ca
......@@ -140,6 +140,15 @@ class Message(Persistent):
message = message.decode('utf-8')
return message
def __len__(self):
return len(str(self))
def __getitem__(self, index):
return str(self)[index]
def __getslice__(self, i, j):
return str(self)[i:j]
InitializeClass(Message)
allow_class(Message)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment