Message from discussion
Inheritance
Received: by 10.236.189.36 with SMTP id b24mr31712756yhn.9.1341947943640;
Tue, 10 Jul 2012 12:19:03 -0700 (PDT)
X-BeenThere: michipug@googlegroups.com
Received: by 10.236.114.20 with SMTP id b20ls3844509yhh.2.gmail; Tue, 10 Jul
2012 12:19:02 -0700 (PDT)
Received: by 10.236.73.131 with SMTP id v3mr31080741yhd.6.1341947942610;
Tue, 10 Jul 2012 12:19:02 -0700 (PDT)
Received: by 10.236.73.131 with SMTP id v3mr31080735yhd.6.1341947942590;
Tue, 10 Jul 2012 12:19:02 -0700 (PDT)
Return-Path: <rdbu...@gmail.com>
Received: from mail-yw0-f50.google.com (mail-yw0-f50.google.com [209.85.213.50])
by gmr-mx.google.com with ESMTPS id f27si3895398anj.1.2012.07.10.12.19.02
(version=TLSv1/SSLv3 cipher=OTHER);
Tue, 10 Jul 2012 12:19:02 -0700 (PDT)
Received-SPF: pass (google.com: domain of rdbu...@gmail.com designates 209.85.213.50 as permitted sender) client-ip=209.85.213.50;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of rdbu...@gmail.com designates 209.85.213.50 as permitted sender) smtp.mail=rdbu...@gmail.com; dkim=pass header...@gmail.com
Received: by yhjj63 with SMTP id j63so424422yhj.37
for <michipug@googlegroups.com>; Tue, 10 Jul 2012 12:19:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:from:date:message-id:subject:to
:content-type;
bh=cEXhRZFsy+fpvN55ZdI6pQbTSqXJZoUlpEHZXn2WiCk=;
b=d4fhWLjI67jzRBA9XbQO/KrvtvsNdobWZ/X3TvwiVg7pE9a/7GUAY6MAUMH2Ho/UNd
HLhxPYryZNifi1VewzCsn2Nbz0oZhN+9oTgUqZkJwuJ196gehOexzEGuaof9rvxDzsRF
+uh6FRJepAMsFQ66zQcYvHGD1sFe4WzQu4lFcrjs8zQP85HHdHQdF6u5zOhZk1rghDv0
4UKRNnRVhiUr/ELAa5WVG6DwrMIYv4ZsGbubtiDEBLyIwzvEVZpbb25Jny23FkdiuSJA
V3F6qgq67Wj3lBwNbZlFizqQrOvybcZZBqJZXV2cAaJOZX5ViS8G+Bbg2+5l3Jm2VZYe
lO+g==
Received: by 10.101.87.7 with SMTP id p7mr11190899anl.52.1341947942410; Tue,
10 Jul 2012 12:19:02 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.236.176.166 with HTTP; Tue, 10 Jul 2012 12:18:32 -0700 (PDT)
In-Reply-To: <CAKbMJAv3T5Vf+w_YJo70nfAwbLpO=8zAHyUmbAKBVHxHJJB...@mail.gmail.com>
References: <2f445566-e5cd-4ae5-8b21-c537046e919f@googlegroups.com>
<CACNEfZZbuxawB88f4esWYG=WKY3JW7wUfpyNKSVJ4O6irKA...@mail.gmail.com>
<ae6e0877-0c20-4039-8c9c-a20d993d3bac@googlegroups.com> <CAGhGXbA=caFfkFWD-H=hmkiwBiW+tS=ETrqdrr0VcfQ9bJ5...@mail.gmail.com>
<CAKbMJAv3T5Vf+w_YJo70nfAwbLpO=8zAHyUmbAKBVHxHJJB...@mail.gmail.com>
From: Ryan Burns <rdbu...@gmail.com>
Date: Tue, 10 Jul 2012 15:18:32 -0400
Message-ID: <CAKbMJAvqhw3xcZ-87NkswBt+5==xQNEm9f3Ye-WLAud0e8h...@mail.gmail.com>
Subject: Re: Inheritance
To: michipug@googlegroups.com
Content-Type: multipart/alternative; boundary=001636eedee86a1ba104c47e9a7c
--001636eedee86a1ba104c47e9a7c
Content-Type: text/plain; charset=ISO-8859-1
Ahaha, the ftplib.FTP class is an old style class in the 2.6 release.
Huh, I checked both the 2.6.8 and 2.7.3 ftplib source and it's an old style
class in both. I'm not sure why it worked for me.
You can still use ftplib.FTP.__init__(self) - super() only really
matters if you have multiple inheritance (feel free to disabuse me of that
notion if it's not the case).
-Ryan
On Tue, Jul 10, 2012 at 3:11 PM, Ryan Burns <rdbu...@gmail.com> wrote:
> I tried this exact code;
>
> import ftplib
> class MyFTP(ftplib.FTP):
> def __init__(self):
> super(MyFTP,self).__init__()
>
>
> And it didn't throw any errors. A quick google indicated this error can
> occur if the parent class you are inheriting from is not a new-style class.
> I'm not sure why that would be the case in your case, although I am on
> 2.7.
>
>
>
> On Tue, Jul 10, 2012 at 3:02 PM, Nancy <eclecticna...@gmail.com> wrote:
>
>> Also I should have mentioned (though don't think it's been a factor yet):
>>
>> Py 2.6 on Win
>>
>> -Nancy
>> On Jul 10, 2012 2:57 PM, "Nancy" <eclecticna...@gmail.com> wrote:
>>
>>>
>>> I appreciate the feedback! So far, now, I have:
>>>
>>> import ftplib
>>> class MyFTP(ftplib.FTP):
>>> def __init__(self):
>>> pass
>>>
>>> I do plan to do some "custom" but am not there yet :)
>>>
>>> I did try this (in place of "pass"): super(MyFTP, self).__init__()
>>> TypeError: super() argument 1 must be type, not classobj
>>>
>>> Thanks again,
>>> -Nancy
>>>
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Michigan Python Users Group" group.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msg/michipug/-/5iTvwqpn_mIJ.
>>> To post to this group, send email to michipug@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> michipug+unsubscribe@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/michipug?hl=en.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Michigan Python Users Group" group.
>> To post to this group, send email to michipug@googlegroups.com.
>> To unsubscribe from this group, send email to
>> michipug+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/michipug?hl=en.
>>
>
>
>
> --
> about.me/ryanburns
>
--
about.me/ryanburns
--001636eedee86a1ba104c47e9a7c
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Ahaha, the ftplib.FTP class is an old style class in the 2.6 release.<div><=
br></div><div>Huh, I checked both the 2.6.8 and 2.7.3 ftplib source and it&=
#39;s an old style class in both. =A0I'm not sure why it worked for me.=
</div>
<div><br></div><div><br></div><div>You can still use ftplib.FTP.__init__(se=
lf) =A0 =A0 =A0- super() only really matters if you have multiple inheritan=
ce (feel free to disabuse me of that notion if it's not the case).</div=
>
<div>
<br></div><div><br></div><div>-Ryan</div><div><br></div><div><br><br><div c=
lass=3D"gmail_quote">On Tue, Jul 10, 2012 at 3:11 PM, Ryan Burns <span dir=
=3D"ltr"><<a href=3D"mailto:rdbu...@gmail.com" target=3D"_blank">rdburns=
@gmail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">I tried this exact code;<div><br></div><div>=
<div class=3D"im"><div>import ftplib</div><div>class MyFTP(ftplib.FTP):</di=
v>
<div>=A0 =A0 def __init__(self):</div></div><div>=A0 =A0 =A0 =A0 super(MyFT=
P,self).__init__()</div><div>=A0 =A0=A0</div><div><br></div><div>And it did=
n't throw any errors. =A0A quick google indicated this error can occur =
if the parent class you are inheriting from is not a new-style class. =A0I&=
#39;m not sure why that would be the case in your case, although I am on 2.=
7. =A0</div>
<div><div class=3D"h5">
<div><br></div><div><br></div><br><div class=3D"gmail_quote">On Tue, Jul 10=
, 2012 at 3:02 PM, Nancy <span dir=3D"ltr"><<a href=3D"mailto:eclecticna=
n...@gmail.com" target=3D"_blank">eclecticna...@gmail.com</a>></span> wro=
te:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><p>Also I should have mentioned (though don&=
#39;t think it's been a factor yet):</p>
<p>Py 2.6 on Win</p><span><font color=3D"#888888">
<p>-Nancy</p></font></span><div><div>
<div class=3D"gmail_quote">On Jul 10, 2012 2:57 PM, "Nancy" <<=
a href=3D"mailto:eclecticna...@gmail.com" target=3D"_blank">eclecticnancy@g=
mail.com</a>> wrote:<br type=3D"attribution"><blockquote class=3D"gmail_=
quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1=
ex">
<div>=A0</div>
<div>I appreciate the feedback! So far, now, I have:</div>
<div>=A0</div>
<div>import ftplib<br>class MyFTP(ftplib.FTP):<br>=A0=A0=A0 def __init__(se=
lf):<br>=A0=A0=A0=A0=A0=A0=A0 pass<br></div>
<div>=A0</div>
<div>I do plan to do some "custom" but am not there yet :)</div>
<div>=A0</div>
<div>I did try this=A0(in place of "pass"):=A0 super(MyFTP, self)=
.__init__()</div>
<div>TypeError: super() argument 1 must be type, not classobj</div>
<div>=A0</div>
<div>Thanks again,</div>
<div>-Nancy</div>
<div><br>=A0</div>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;Michigan Python Users Group" group.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/d/msg/michipug/-/5iTvwqpn_mIJ" target=3D"_blank">https://groups.google.c=
om/d/msg/michipug/-/5iTvwqpn_mIJ</a>.<br>=20
To post to this group, send email to <a href=3D"mailto:michipug@googlegroup=
s.com" target=3D"_blank">michipug@googlegroups.com</a>.<br>
To unsubscribe from this group, send email to <a href=3D"mailto:michipug%2B=
unsubscribe@googlegroups.com" target=3D"_blank">michipug+unsubscribe@google=
groups.com</a>.<br>
For more options, visit this group at <a href=3D"http://groups.google.com/g=
roup/michipug?hl=3Den" target=3D"_blank">http://groups.google.com/group/mic=
hipug?hl=3Den</a>.<br>
</blockquote></div>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;Michigan Python Users Group" group.<br>
To post to this group, send email to <a href=3D"mailto:michipug@googlegroup=
s.com" target=3D"_blank">michipug@googlegroups.com</a>.<br>
To unsubscribe from this group, send email to <a href=3D"mailto:michipug%2B=
unsubscribe@googlegroups.com" target=3D"_blank">michipug+unsubscribe@google=
groups.com</a>.<br>
For more options, visit this group at <a href=3D"http://groups.google.com/g=
roup/michipug?hl=3Den" target=3D"_blank">http://groups.google.com/group/mic=
hipug?hl=3Den</a>.<br>
</div></div></blockquote></div><br><br clear=3D"all"><div><br></div></div><=
/div><span class=3D"HOEnZb"><font color=3D"#888888">-- <br><font face=3D"&#=
39;courier new', monospace"><a href=3D"http://about.me/ryanburns" targe=
t=3D"_blank">about.me/ryanburns</a></font><br>
</font></span></div>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><font face=
=3D"'courier new', monospace"><a href=3D"http://about.me/ryanburns"=
target=3D"_blank">about.me/ryanburns</a></font><br>
</div>
--001636eedee86a1ba104c47e9a7c--