Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First of call you need to keep in mind that Python 2.x shares mostly the same syntax which is backward compatible, new features &amp; additions aside. There are other things to consider that aren't necessarily errors, such as DeprecationWarning messages that while not detrimental, are ugly and can cause confusion. </p> <p>Python 3.x is backward-INcompatible by design and intends to leave all of the old cruft behind. Python 2.6 introduced many changes that are also in Python 3.x to help ease the transition. To see all of them I would recommend reading up on the <a href="http://docs.python.org/whatsnew/2.6.html" rel="nofollow noreferrer">What's New in Python 2.6</a> document. For this reason, it is very possible to write code for Python 2.6 that will also run in Python 3.1, but that is not without its caveats.</p> <p>Even still there are many minor syntax changes even between 2.x versions that will require you you wrap a lot of your code in <code>try</code>/<code>except</code> blocks, so if this is what you're willing to do then having a 2.x and 3.x branch is totally possible. I think you'll find that you'll be doing a lot of attribute and type tests on your objects to do what you want to do. </p> <p>I would recommend you check out the code of major projects out there that support various Python versions. <a href="http://twistedmatrix.com/" rel="nofollow noreferrer">Twisted Matrix</a> is the first one that comes to mind. Their code is a wonderful example of how Python code should be written.</p> <p>In the end, what you're setting out to do will not be easy, so prepare yourself for a lot of work! </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload