AttributeError - a dumb question

Stidolph, David stidolph at origin.ea.com
Tue Jul 6 13:13:48 EDT 1999


Python is case sensitive:

class F:
    def __init__(self):

        self.x = self.KryLys() #note the upper case L

    def KryLys(self):
        l = [1,2,3,4,5]
        return l
    

l = F()
-----Original Message-----
From: Johann Spies [mailto:jhspies at futurenet.co.za]
Sent: Tuesday, July 06, 1999 11:24 AM
To: python-list at cwi.nl
Subject: Re: AttributeError - a dumb question


Hallo Oleg,

Thanks for your reply.  Your answer helped me to back to the original
problem I had:

class F:
    def __init__(self):

        self.x = self.Krylys()

    def KryLys(self):
        l = [1,2,3,4,5]
        return l
    

l = F()

Now this assignment fails:

Traceback (innermost last):
  File "<stdin>", line 11, in ?
  File "<stdin>", line 4, in __init__
AttributeError: Krylys

I hope you can help me with this one.

Johann

 --------------------------------------------------------------------------
| Johann Spies                                 Windsorlaan 19              |
| jhspies at futurenet.co.za                3201 Pietermaritzburg             |
| Tel/Faks Nr. +27 331-46-1310		       Suid-Afrika (South Africa)  |
 --------------------------------------------------------------------------

     "Ask, and it shall be given you; seek, and ye shall
      find; knock, and it shall be opened unto you."        
                                  Matthew 7:7 







More information about the Python-list mailing list