On Fri, Nov 20, 2015 at 11:58 PM, srinivas devaki
<mr.eightnotei...@gmail.com> wrote:
>     def __str__(self):
>         if len(self.list) == 0:
>             return '(' + str(self.data) +  ')[...]'
>         return ''.join(['(', str(self.data), ')['] + map(str, self.list) + 
> [', ...]'])
> ...
> Gist: https://gist.github.com/c0c2ee1e7c6535ef8c3d

uhh, there is an error in representing it, the code should be

def __str__(self):
    if len(self.list) == 0:
        return '(' + str(self.data) +  ')[...]'
    return ''.join(['(', str(self.data), ')[', ', '.join(map(str,
self.list)), ', ...]'])

Output:
(None)[...]
(None)[(None)[...], (None)[...], (None)[...], (20)[...], ...]


ps: code is updated in gist.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to