Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.032 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'attribute': 0.07; 'correct.': 0.07; 'responding': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'buggy': 0.16; 'fine.': 0.16; 'instances,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'supplied': 0.16; 'elements': 0.16; 'wrote:': 0.18; 'not,': 0.20; 'print': 0.22; 'header:User-Agent:1': 0.23; 'either.': 0.24; 'url:moin': 0.24; 'question': 0.24; 'mention': 0.26; 'header:X -Complaints-To:1': 0.27; 'have,': 0.30; 'returned': 0.30; "i'm": 0.30; 'url:wiki': 0.31; 'class': 0.32; 'another': 0.32; 'url:python': 0.33; 'not.': 0.33; 'maybe': 0.34; 'subject:with': 0.35; "can't": 0.35; 'but': 0.35; 'really': 0.36; 'described': 0.36; 'charset:us-ascii': 0.36; 'url:org': 0.36; 'example,': 0.37; 'list': 0.37; 'to:addr:python-list': 0.38; 'list,': 0.38; 'visual': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'read': 0.60; 'dave': 0.60; 'referred': 0.60; 'tell': 0.60; "you're": 0.61; 'first': 0.61; 'real': 0.63; 'different': 0.65; 'anything.': 0.68; 'line,': 0.68; 'guessed': 0.84; 'intending': 0.84; 'neck,': 0.84; 'subject:Lists': 0.91; 'quotation': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dave Angel Subject: Re: Dealing with Lists Date: Tue, 10 Sep 2013 22:32:25 +0000 (UTC) References: <33650fe9-802e-477d-a361-6d4bdeb28762@googlegroups.com> <3d1eaccc-cf89-4eb0-b96c-b22a0a2f758e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 174.32.174.36 User-Agent: XPN/1.2.6 (Street Spirit ; Linux) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 47 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1378852367 news.xs4all.nl 15914 [2001:888:2000:d::a6]:43925 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:53931 On 10/9/2013 18:11, stas poritskiy wrote: Please include some quotation from the message you're replying to. We can't tell who this was responding to until the very last line, where you mention my name. But since you're using buggy googlegroups, you'd better also read http://wiki.python.org/moin/GoogleGroupsPython > Those simbols are just for visual representation. > Fine. I just don't know what they represent. > I need to store each of the first elements of a par, so I can reference to them as to a parent of another group. Don't know what that means either. > > So head is parent of neck, while neck is parent of arms and so on. They're just strings, not parents of anything. But the real question is whether that list I described is what you wanted: ["head", ["neck", ["arms", ["legs"]]]] > > I'm not sure I understand how to apply your chop list example, dave Call it with a list, and it returns a different one. if I guessed your intent, then the returned list will be correct. If not, then not. myGroups = ["head", "neck", "arms", "legs"] my_directory = chop_up(myGroups) print my_directory Maybe what you were really intending was to build a class that you can create several instances, where an attribute of each instance referred to any children it might have, and a different attribute supplied the instance's name. -- DaveA