help needed with class and method confusion
Cndistin
cndistin at aol.com
Tue Jan 6 10:22:32 EST 2004
More information about the Python-list mailing list
Tue Jan 6 10:22:32 EST 2004
- Previous message (by thread): help needed with class and method confusion
- Next message (by thread): help needed with class and method confusion
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
First I am sorry for the title but I an newbie enough to now know how to better
word it.
The problem part of my code is
class Application:
class Moon:
def __init__(self, name):
self.name = name
def __init__(self):
self.moons = []
names = ["Io", "Europa", "Ganymeade"]
for name in names:
setattr(self, name, Moon(name))
I would like to somehow get self.moons to equal
[self.Io, self.Europa, self.Ganymeade]. I had hoped on using
self.moons as an iterant in "for" loops to be able to alter each
in turn.
Thanks in advance for any possible help.
- Previous message (by thread): help needed with class and method confusion
- Next message (by thread): help needed with class and method confusion
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list