[Tutor] constructors

alan.gauld@bt.com alan.gauld@bt.com
Wed, 14 Mar 2001 10:38:29 -0000


> class ConnectInfo:
>         def _init_(self, accname):
>                 self.accname=accname

init() should have two underscores each side. 
That's a common Python convention for special 
methods like init

ie 
	def __init__(self, accname):...


> Traceback (innermost last):
>   File "test.sh", line 15, in ?
>     main()
>   File "test.sh", line 11, in main
>       connect = ConnectInfo("me")

Hmm, there should have been another line giving the actual 
error message - usually the most important bit! Are you 
sure thats all it said?

Alan g.