> -- > 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/-/co5-M_x2mD4J.
> 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.
I'm sure you can also take a variable number of arguments to match the FTP
init precisely, I think you would say something like *args and then pass
that to the FTP init?
On Tue, Jul 10, 2012 at 1:30 PM, Jay Wren <jrw...@gmail.com> wrote:
> That works, but you are allocating and initializing the FTP member and
> never using it.
> --
> 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/-/co5-M_x2mD4J.
> 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.
> --
> 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/-/co5-M_x2mD4J.
> 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.
-- Paul Woolcock
Twitter @pwoolcoc
Github @pwoolcoc
> 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.
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.
>> 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.
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).
> 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):
>>> 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.
On Tue, Jul 10, 2012 at 3:18 PM, Ryan Burns <rdbu...@gmail.com> wrote:
> 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:
>> 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):
>>>> 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.
> Oh, it worked for me because I didn't create an instance of MyFTP when I
> tested it, and that is of course when the error occurs.
> Long story short: you can't use super() if you're inheriting from
> ftplib.FTP in that version of Python, but in general it's the way to go.
> On Tue, Jul 10, 2012 at 3:18 PM, Ryan Burns <rdbu...@gmail.com> wrote:
>> 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:
>>> 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):
>>>>> 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
> --
> about.me/ryanburns
> --
> 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.