Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #99182

Re: How To Create A Endles List Of Lists In Python...???

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From srinivas devaki <mr.eightnoteight@gmail.com>
Newsgroups comp.lang.python
Subject Re: How To Create A Endles List Of Lists In Python...???
Date Sat, 21 Nov 2015 00:05:41 +0530
Lines 23
Message-ID <mailman.18.1448044587.2291.python-list@python.org> (permalink)
References <n2miu8$fl4$1@ls237.t-com.hr> <mailman.510.1448009596.16136.python-list@python.org> <n2mugp$kt1$1@ls237.t-com.hr> <564F1AC0.5040106@shopzeus.com> <CAPTjJmpJoktL=OdaCOw3KGukxUKBu+nW+cUFvwv47KCczAKXsg@mail.gmail.com> <CACs7g=B0AyWyQ61FU+7V=r2P1t1A5d90DiQ0tyJAv=yaBAUwzQ@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de cCNFQCeeGyG/uu7uIoYK1AZ9EsQFQtL3sUvYci3CXblg==
Return-Path <mr.eightnoteight@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.012
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'cc:addr:python-list': 0.09; 'subject:How': 0.09; 'url:github': 0.09; 'def': 0.13; "'('": 0.16; '...]': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'header:In-Reply-To:1': 0.24; 'error': 0.27; 'fri,': 0.27; 'message-id:@mail.gmail.com': 0.27; "skip:' 10": 0.28; 'code': 0.30; 'skip:_ 10': 0.32; 'subject:List': 0.33; 'received:google.com': 0.35; 'nov': 0.35; 'should': 0.36; 'there': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; '20,': 0.66; 'subject:Lists': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=zVYiwSbP/f+VpH7flS6DaRYFsX3QYQcKB8qSexrz3dE=; b=0TnNij6s9Vr/Vwd+IQx2swWjnCUBPcSc0uADWUQpIzyPuHaXkAUFXb9gvjomVJkYOi uoSyYYCDIFjWwrPDbzVq2lX8CacAxIEJXNYqcYxELbzk54ICUrtr+aE0cz92pKGlR3Q7 +HyZXRVVcf76QrNb6NW3jOsZA5wJhghs0DvpswSwvlL7L/Oeq8iMZ5TiNeueUiEiRs7z 71q1QPFQqLRUNWezoVmaGOdhexY4If/eVmHoteV4YylWyrUhb/med1bkXsaRs7ws/FoS mFXbK7TNfDebEgvG+ilJ0ugmBVFmDOh4Sc7nCPUZn+iFvDeBHxQ9xhoq00KEcrN6RkAz rlLA==
X-Received by 10.50.57.84 with SMTP id g20mr1337357igq.44.1448044580498; Fri, 20 Nov 2015 10:36:20 -0800 (PST)
In-Reply-To <CACs7g=B0AyWyQ61FU+7V=r2P1t1A5d90DiQ0tyJAv=yaBAUwzQ@mail.gmail.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:99182

Show key headers only | View raw


On Fri, Nov 20, 2015 at 11:58 PM, srinivas devaki
<mr.eightnoteight@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.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How To Create A Endles List Of Lists In Python...??? "HKRSS" <hkrss@gmail.com> - 2015-11-20 08:43 +0100
  Re: How To Create A Endles List Of Lists In Python...??? "HKRSS" <hkrss@gmail.com> - 2015-11-20 09:13 +0100
  Re: How To Create A Endles List Of Lists In Python...??? Peter Otten <__peter__@web.de> - 2015-11-20 09:53 +0100
    Re: How To Create A Endles List Of Lists In Python...??? "HKRSS" <hkrss@gmail.com> - 2015-11-20 12:00 +0100
      Re: How To Create A Endles List Of Lists In Python...??? Nagy László Zsolt <gandalf@shopzeus.com> - 2015-11-20 14:06 +0100
        Re: How To Create A Endles List Of Lists In Python...??? robert.bralic@si.t-com.hr - 2015-11-20 05:29 -0800
      Re: How To Create A Endles List Of Lists In Python...??? Chris Angelico <rosuav@gmail.com> - 2015-11-21 00:09 +1100
      Re: How To Create A Endles List Of Lists In Python...??? Grant Edwards <invalid@invalid.invalid> - 2015-11-20 15:58 +0000
      Re: How To Create A Endles List Of Lists In Python...??? srinivas devaki <mr.eightnoteight@gmail.com> - 2015-11-20 23:58 +0530
      Re: How To Create A Endles List Of Lists In Python...??? srinivas devaki <mr.eightnoteight@gmail.com> - 2015-11-21 00:05 +0530
  Re: How To Create A Endles List Of Lists In Python...??? Denis McMahon <denismfmcmahon@gmail.com> - 2015-11-20 17:14 +0000
    Re: How To Create A Endles List Of Lists In Python...??? robert.bralic@si.t-com.hr - 2015-11-20 10:16 -0800
      Re: How To Create A Endles List Of Lists In Python...??? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-20 11:29 -0700
      Re: How To Create A Endles List Of Lists In Python...??? Chris Angelico <rosuav@gmail.com> - 2015-11-21 05:30 +1100
      Re: How To Create A Endles List Of Lists In Python...??? sohcahtoa82@gmail.com - 2015-11-20 11:26 -0800

csiph-web