[Tutor] Need Simple Inheritance example

Tim Johnson tim@johnsons-web.com
Sat, 16 Mar 2002 10:30:29 -0900


* Lloyd Kvam <pythontutor@venix.com> [020316 09:45]:
> My best guess is that you have a typo!
 
  Yes, you are correct. Thank you!

> __init__ has a parameter _profile
> BUT the call to login uses profile (witout the leading _)
> 
> Tim Johnson wrote:
> 
> >Hello All:
> >    Using python 2.1 on RH 7.2, Win98
> >
> >    I'd like to build an FTP object that initializes with
> >    Host, login, and password as elements of a list, and
> >    then overloads the transfer methods with progress reporting.
> >
> >    I've begun with the following code:
> >    class FtpNew(FTP):
> >        def __init__(self,_profile):
> >            self.login(profile[1],profile[2])
> >
> >    and I would like to initialize the instance as
> >
> >    params = ['www.host.com','login','password']
> >    ftp = FtpNew(params)
> >
> >    I'm getting error messages about 'profile' being an undefined 
> >    global.
> >    Can anyone help me out here?
> >    Best regards
> >
> 
> 
> -- 
> Lloyd Kvam
> Venix Corp.
> 1 Court Street, Suite 378
> Lebanon, NH 03766-1358
> 
> voice: 
> 603-443-6155
> fax: 
> 801-459-9582

-- 
Tim Johnson <tim@johnsons-web.com>
      http://www.alaska-internet-solutions.com
      http://www.johnsons-web.com