qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC v4 02/32] qapi: New QAPISchema intermediate


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH RFC v4 02/32] qapi: New QAPISchema intermediate reperesentation
Date: Fri, 4 Sep 2015 09:51:39 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Fri, Sep 04, 2015 at 09:12:09AM +0200, Markus Armbruster wrote:
> "Daniel P. Berrange" <address@hidden> writes:
> 
> > On Thu, Sep 03, 2015 at 04:29:53PM +0200, Markus Armbruster wrote:
> > Python has a nice tool called pep8 which can apply a
> > configurable bunch of  style checks, it is probably
> > worth someone wiring it up to make check in QEMU, since
> > we have an increasing amount of python code. An exercise
> > for a motivated reader.....
> 
> I've been using pylint (and dear-oh-dear how much pre-existing lint it
> finds!), wasn't aware of pep8, can throw it in.

The pep8 tool is design around checking the "official" python style
rules as defined by Guido, and seems to be more commonly used than
pylint IME.

> Automatic checking would be nice, but our current code is probably too
> untidy for that.  Besides, I don't have the time and energy to set it
> up now.

Yeah, no big deal.


> >> +class QAPISchema(object):
> >> +    def __init__(self, fname):
> >> +        try:
> >> + self.exprs = check_exprs(QAPISchemaParser(open(fname, "r")).exprs)
> >> +        except (QAPISchemaError, QAPIExprError), err:
> >
> > Preferred syntax for exceptions these days is
> >
> >   except Foo as err
> >
> > instead of
> >
> >   except Foo, err
> >
> > since the former is portable to Python3, should we need to consider
> > that in future. Again, not a show stopper.
> 
> Does it work with Python 2.4?  That's where we're currently stuck.

Urgh, that's a shame, what distro requires such an ancient
python ? That syntax is only valid from 2.6 onwards.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]