[Zope-dev] Use of python3 compatibility packages six vs. futurize

Martin Häcker mh at sntl-publishing.com
Thu Oct 6 10:32:30 CEST 2016


On 04.10.16 13:49, Hanno Schlichting wrote:
> I think it is preferable if we stick to a single project, which gets
> used as a runtime dependency, and since six is already used in many
> projects, I'd continue to use it everywhere.

That does make a lot of sense - hence why I stuck with six and asked
this question here.

> The 2to3 script or versions thereof shouldn't introduce a new runtime
> dependency, as you only need to check in the code produced by these
> scripts, so you can use those just fine. I've also used the zope.fixers
> project, which extends 2to3 to apply some zope.interface specific
> conversions.

zope.fixers is new to me - I'l have a look there. Regarding 2to3 of
futurize: It does depend on futurize, as futurize provides backports of
the new python3 types (bytes most prominently, but pretty much all of
them) and knows how to import and use them from futurize. So it does do
stuff other 2to3 utilities can't do.

> One thing I do find helpful is running a Python 3 pep8/flake8 over the
> codebase, as it points out most of the places where you have invalid
> Python 3 syntax.

futurizes 2to3 shell script implementation is called 'futurize' and it
can run in multiple stages. Stage1 will just upgrade code to idomatic
python 2.7 so you can get rid of almost all the incompatible syntax with
strong guarantees that no intention change is done. Also, since this
doesn't add any dependency on futurize, its something I can recommend.

> Just my 2 cents,
> Hanno

Thanks! :)


More information about the Zope-Dev mailing list