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


Groups > comp.lang.python > #53931

Re: Dealing with Lists

From Dave Angel <davea@davea.name>
Subject Re: Dealing with Lists
Date 2013-09-10 22:32 +0000
References <33650fe9-802e-477d-a361-6d4bdeb28762@googlegroups.com> <mailman.226.1378849885.5461.python-list@python.org> <3d1eaccc-cf89-4eb0-b96c-b22a0a2f758e@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.227.1378852367.5461.python-list@python.org> (permalink)

Show all headers | View raw


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

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


Thread

Dealing with Lists stas poritskiy <stascrash@gmail.com> - 2013-09-10 14:08 -0700
  Re: Dealing with Lists stas poritskiy <stascrash@gmail.com> - 2013-09-10 14:10 -0700
  Re: Dealing with Lists matt.komyanek@gmail.com - 2013-09-10 14:31 -0700
  Re: Dealing with Lists Dave Angel <davea@davea.name> - 2013-09-10 21:51 +0000
    Re: Dealing with Lists stas poritskiy <stascrash@gmail.com> - 2013-09-10 15:11 -0700
      Re: Dealing with Lists Roy Smith <roy@panix.com> - 2013-09-10 18:30 -0400
      Re: Dealing with Lists Dave Angel <davea@davea.name> - 2013-09-10 22:32 +0000
  Re: Dealing with Lists Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-11 02:14 +0000
    Re: Dealing with Lists Dave Angel <davea@davea.name> - 2013-09-11 02:24 +0000
      Re: Dealing with Lists Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-11 03:13 +0000
        Re: Dealing with Lists stas poritskiy <stascrash@gmail.com> - 2013-09-10 20:44 -0700
        Re: Dealing with Lists stas poritskiy <stascrash@gmail.com> - 2013-09-10 20:52 -0700
          Re: Dealing with Lists stas poritskiy <stascrash@gmail.com> - 2013-09-11 07:47 -0700
            Re: Dealing with Lists stas poritskiy <stascrash@gmail.com> - 2013-09-11 07:57 -0700
              Re: Dealing with Lists Peter Otten <__peter__@web.de> - 2013-09-11 18:17 +0200

csiph-web