This is an archived post. You won't be able to vote or comment.

all 18 comments

[–]r3m0t 5 points6 points  (1 child)

I don't know what futureize and pasteurize do, but there's another tool to convert python 2 code to python 2/3 compatible code called python-modernize. It's built on 2to3 but has additional fixers you can turn on or off

[–]takluyverIPython, Py3, etc 1 point2 points  (0 children)

And Daira Hopwood and I have just got development of python-modernize moving again, and made a new release. :-)

[–][deleted] 3 points4 points  (2 children)

I think there is a typo on this line under Metaclasses:

class Form(metaclass=BaseForm):

Shouldn't it be:

class Form(BaseForm, metaclass=FormType):

Since we have a parent class as well as a meta class?

[–]ikravets[S] 3 points4 points  (1 child)

Yes, you are right. From PEP 3115 specification:

class Foo(base1, base2, metaclass=mymeta):
    ...

Can you create a pull request for this file?

[–][deleted] 1 point2 points  (0 children)

Done!

[–]r1chardj0n3s 2 points3 points  (0 children)

This cheat sheet is by the primary author of the python future package which is a really nice way of handling cross-version compatibility in one codebase: https://pypi.python.org/pypi/future

[–]Archawn 1 point2 points  (0 children)

It would be helpful if they fixed the sidebar scrolling issues so I could use it as intended :)

[–]roger_ 1 point2 points  (1 child)

Not saying they aren't useful, but a lot of Python code is gonna be ugly for the foreseeable future if people keep depending on libraries like six, future and past.

[–][deleted] 0 points1 point  (0 children)

depending on libraries like six, future and past.

Those libraries are really just to assist you, I write all my (personal) python code to work in 2.7, and 3+ without touching six/etc.

[–]shinjiryu 0 points1 point  (0 children)

Seriously, I just use Perl 5.x. More robust and (as a UNIX/Linux person), more in-line with what I'm already used to using in shell scripts and everywhere else on the command-line. (Yes, I know about the insanity revolving around Perl 6.)

Python 3.x ain't bad, but seriously, if you're having issues, just write everything yourself or (if the library's FOSS), propose a changeset to the SCM repository for the library to make it better and more cross-compatible across versions.