[ovs-dev] [PATCH 2/9] tests: Convert ovsdb-monitor-sort utility from Perl to Python.

Ben Pfaff blp at ovn.org
Mon Nov 20 18:03:58 UTC 2017


On Thu, Nov 16, 2017 at 09:35:48AM -0500, Aaron Conole wrote:
> Ben Pfaff <blp at ovn.org> writes:
> 
> > Perl is unfashionable and Python is more widely available and understood,
> > so this commit converts one of the OVS uses of Perl into Python.
> >
> > Signed-off-by: Ben Pfaff <blp at ovn.org>
> > +# This is copied out of the Python Sorting HOWTO at
> > +# https://docs.python.org/3/howto/sorting.html#sortinghowto
> > +def cmp_to_key(mycmp):
> > +    'Convert a cmp= function into a key= function'
> > +    class K:
> 
> I get a flake8 complaint for this - I think it should be:
> 
>  class K(object):
>  ...

Thanks, fixed.

(It is somewhat hilarious that Python documentation doesn't follow
Python standards, though.)


More information about the dev mailing list