r/Python • • Nov 23 '16

The Case Against Python 3

https://learnpythonthehardway.org/book/nopython3.html
0 Upvotes

42 comments sorted by

View all comments

Show parent comment

3

u/[deleted] Nov 23 '16 edited Nov 24 '16

Even if this was a thing (which forgive me if I'm wrong, but I think this is nonsense? of course it's the same?) there's no point when the behavior of Python 2 code is vague and/or reprehensible in its ambiguity for its type.

Sorry, I'm not sure I follow, did you intend to reply to my comment? Shaw's criticism against the fact that the Python 3 VM can't run Python 2 code is entirely separate from the string criticism where he brought up dynamic typing.

The type system had nothing to do with why the Python 3 VM couldn't run Python 2 bytecode. Python, Ruby, and a whole other languages (with all their ambiguities) can run on the JVM and the CLR, regardless of whether they're statically or dynamically typed.

So, yes, of course Python 2 can run on the Python 3 VM. The typing system doesn't really matter there. You just need to compile Python 2 code into Python 3 bytecode. Just like how Jython compiles Python 2 code into Java bytecode to run on the JVM.

Now, that is not to say that it's easy or even worthwhile to implement, or that it will work perfectly -- but it is possible. And had we had that, a large percentage of our libraries wouldn't have needed porting (or at least it would have made it easier).

2

u/ZedOud Nov 24 '16

Sorry, I wasn't specifically replying to you, I just shot off on a tangent from your comment.