Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

python classes

Name: Anonymous 2010-01-05 23:50

OK, say I need to create an application that simulates a
family tree.  Each member may have a mom dad and kids.

I need to create a family tree class that contains a
collection of these member class objects and methods for
adding branches, removing members, etc...

I'm mainly having a hard time figuring how to join the
members if that makes sense.

I've got something like...

class member(object):
   
    def __init__(self):
       member.kid = self[0]
       member.dad = self[1]
       etc...


class familyTree(object):

    def __init___(self):
        for m in mlist:
            try:
                m = member(m)

blah blah blah


How to I make the familytree class contain a
collection of member class objects?

Name: Anonymous 2010-01-06 19:52

The question was about building a tree class with nodes
in it.

Should I have a tree class and a node class, or just a
tree class?  Does anybody have any advice?  Is this a
fairly common task?  Have you coded this in other
languages, etc....

What's so hard about this?  Everybody would rather talk
about how to quote in BB code?  Really?

And before telling me I need to improve my general
programming abilities let me tell you that this is
exactly what I am trying to do.  All of us start
somewhere and increment from that point.  We don't pop
out of zeus' head knowing everything with all volumes
of TAOCP memorized.

A simple question deserves a simple answer dickwads.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List