This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xtreak
Recipients benjamin.peterson, devarakondapranav, xtreak
Date 2018-10-04.16:18:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1538669939.56.0.545547206417.issue34893@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks for the report. In my opinion it's difficult to handle this scenario and as far as I know 2to3 can only do syntax level changes with modular fixers for each case. Since Python is dynamic and there is no static type system available it's difficult to differentiate between a socket object and any other object that has the same API with send and recv methods like below : 

if foo():
    s = Socket()
else:
    s = AnotherSocketAPI()

Hence in this case s might be another object that might have the same interface like Socket expecting string for send and recv. Since there is no static typing in Python it depends on runtime introspection to get it right. I will wait for others opinion on this.
History
Date User Action Args
2018-10-04 16:18:59xtreaksetrecipients: + xtreak, benjamin.peterson, devarakondapranav
2018-10-04 16:18:59xtreaksetmessageid: <1538669939.56.0.545547206417.issue34893@psf.upfronthosting.co.za>
2018-10-04 16:18:59xtreaklinkissue34893 messages
2018-10-04 16:18:59xtreakcreate