Yes, you are right, - Shuying Wang's suggestion fixed
the immediate problem, but there is still someting
wrong with my code - maybe I'll ask about it again
later.
--- Ewald Ertl <[EMAIL PROTECTED]> wrote:
> >
> Have a more precisely look at your code.
> s.getName() does just return, what you h
Hi!
Ben Vinger wrote:
> Hello
>
> I've been reading about how a class has access to its
> own 'self', so I tried the following, but it is not
> working as I would expect:
>
> class Skill:
>def __init__(self):
> self.history = []
>
>def setName(self, skill):
> self.nam
Ben,
If you change example #b to:
for s in SkillNames:
skill = Skill()
skill.setName(s)
print skill.getName()
You will find that the results are the same as #a. In your #b example,
you are giving setName() the skill instance instead of the string you
intended.
--Shuying
On 1/19/06, Be
Hello
I've been reading about how a class has access to its
own 'self', so I tried the following, but it is not
working as I would expect:
class Skill:
def __init__(self):
self.history = []
def setName(self, skill):
self.name = skill
def getName(self):
return se