Re: [python-uk] Python 2.7 code: a spring-clean

2019-12-05 Thread Steve Holden
There's been loose talk of adding "minus2" fixers to 2to3, but I don't know whether there's been any concrete progress. At least most refactorings will be taking place on a code base that already runs on Python 3, so tests (where they exist) can ensure that such automated refactorings would do rel

Re: [python-uk] Python 2.7 code: a spring-clean

2019-12-04 Thread Richard Barran
That might do the trick - I’ll try it out. Mucho thanks! > On 4 Dec 2019, at 10:51, Jonathan Lange wrote: > > We've had good luck using https://github.com/asottile/pyupgrade > as a pre-commit hook (see > https://pre-commit.com/

Re: [python-uk] Python 2.7 code: a spring-clean

2019-12-04 Thread Jonathan Lange
We've had good luck using https://github.com/asottile/pyupgrade as a pre-commit hook (see https://pre-commit.com/ – highly recommended). We were already using Python 3, but it's helped us deal with some of the 3.n -> 3.n+1 upgrades. On Tue, 3 Dec 2019 at 21:23, Richard Barran wrote: > Hi all, >

Re: [python-uk] Python 2.7 code: a spring-clean

2019-12-03 Thread Steve - Gadget Barnes
more but in many cases results in a lot more noise. Steve (Gadget). -Original Message- From: python-uk On Behalf Of Richard Barran Sent: 03 December 2019 21:13 To: UK Python Users Subject: [python-uk] Python 2.7 code: a spring-clean Hi all, With the end-of-life of Python 2 upon us, I

[python-uk] Python 2.7 code: a spring-clean

2019-12-03 Thread Richard Barran
Hi all, With the end-of-life of Python 2 upon us, I wondered about cleaning up code that has (had!) to support both Python 2 and Python 3. Some of it is easy (e.g. look for any references to the ‘six’ library), some of it is relatively easy (e.g. super(Foobar, self) ) and… actually, there could