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

Richard Barran richard at arbee-design.co.uk
Wed Dec 4 13:12:35 EST 2019


That might do the trick - I’ll try it out. Mucho thanks!

> On 4 Dec 2019, at 10:51, Jonathan Lange <jml at mumak.net> wrote:
> 
> We've had good luck using https://github.com/asottile/pyupgrade <https://github.com/asottile/pyupgrade> as a pre-commit hook (see https://pre-commit.com/ <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 <richard at arbee-design.co.uk <mailto:richard at arbee-design.co.uk>> wrote:
> 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 be quite a few things to tidy up. 
> 
> I’m wondering if there is a script out there to quickly introspect a codebase and flag up any legacy code? I’ve tried googling but drew up a blank. Any suggestions welcome!
> 
> Richard 
> _______________________________________________
> python-uk mailing list
> python-uk at python.org <mailto:python-uk at python.org>
> https://mail.python.org/mailman/listinfo/python-uk <https://mail.python.org/mailman/listinfo/python-uk>
> _______________________________________________
> python-uk mailing list
> python-uk at python.org
> https://mail.python.org/mailman/listinfo/python-uk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-uk/attachments/20191204/62ec42ad/attachment.html>


More information about the python-uk mailing list