Karthikeyan Singaravelan <tir.kar...@gmail.com> added the comment:

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.

----------
nosy: +xtreak

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34893>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to