Been porting a fair amount of code from to at @logilab recently. Here's a thread about how I usually proceed and what I learnt. (1/7)


Try an automatic code porting tool, like python-modernize.readthedocs.i, to remove idioms. This is no silver bullet but it helps. For instance, it will detect things now in six.moves (like itertools.imap) or usage of .next() and update your code. On the other hand, it sometimes does useless things like changing "for k, v in d.iteritems():" into "for k, v in six.iteritems(d):".


Sign in to participate in the conversation
La Quadrature du Net - Mastodon - Media Fédéré

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!