You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python 2.7 is pretty much at the end of it's support life-span (and way past the end of development). We dev'd for 2.7 originally b/c of external constraints in our first runtime environments. Those are now gone.
This ticket is for tracking what needs to get changed. This is not a complete list but hopefully covers the big ones. Hopefully the "-3" option from the prev link covers these:
integer division returns a float. Use a // b to get the old C-style, truncating division.
xrange is gone, range now does what xrange used to do. to get old range behavior, coerce xrange output to a list.
dict.iterkeys, iteritems, etc. are gone. dict.key, etc. now return "itemview" which is more similar to an iterator.
zip returns an iterator (instead of a list)
new metaclass syntax
total redefine of how unicode vs binary/byte data is handled; i don't think this applies to us.
** https://docs.python.org/2/library/2to3.html hopefully fixes many (all?) of these issues automagically
f(a : "a thing",
b : "another thing",
c : "whoa",
):
pass
which is all accessible introspectively.
exception chaining: https://docs.python.org/3/whatsnew/3.0.html#changes-to-exceptions if handlers run into issues, you can throw new exceptions and have the old ones saved. could be nice for holding onto errors from C++ where we attempt handling/fixing in Python or try to reinvoke C++ or whatnot.
The text was updated successfully, but these errors were encountered:
Python 2.7 is pretty much at the end of it's support life-span (and way past the end of development). We dev'd for 2.7 originally b/c of external constraints in our first runtime environments. Those are now gone.
The python-suggested basic workflow for doing this conversion:
https://docs.python.org/3/whatsnew/3.0.html#porting-to-python-3-0
more detailed:
https://docs.python.org/3/howto/pyporting.html
This ticket is for tracking what needs to get changed. This is not a complete list but hopefully covers the big ones. Hopefully the "-3" option from the prev link covers these:
Note that pyramid itself is compatible with 3.4.
print
is now a statement (wow thank god)a // b
to get the old C-style, truncating division.** https://docs.python.org/2/library/2to3.html hopefully fixes many (all?) of these issues automagically
something cool:
function annotations: http://legacy.python.org/dev/peps/pep-3107/
We annotate params/types separately in the docstring. This lets you do it in the arglist:
which is all accessible introspectively.
exception chaining: https://docs.python.org/3/whatsnew/3.0.html#changes-to-exceptions if handlers run into issues, you can throw new exceptions and have the old ones saved. could be nice for holding onto errors from C++ where we attempt handling/fixing in Python or try to reinvoke C++ or whatnot.
The text was updated successfully, but these errors were encountered: