Python advice needed to survive check-code

Matt Mackall mpm at selenic.com
Wed Jan 11 09:09:12 CST 2012


On Wed, 2012-01-11 at 13:10 +0100, Benoit Boissinot wrote:
> On Wed, Jan 11, 2012 at 11:25 AM, Jim Hague <jim.hague at acm.org> wrote:
> > The problem is that for this to work cookietransportrequest has to be an old-
> > style class to match xmlrpclib.(Safe|)Transport, or __init__s don't get called
> > properly. But then I fall foul of check-code.py, and I don't see a way to turn
> > off the check for just that class def, only the entire file, which seems
> > overkill. Alternatively, I can make it work with a new-style
> > cookietransportrequest by explicitly calling the Transport __init__s, but that
> > seems somehow a bit ugly.
> >
> > I'm unsure how to proceed. Any suggestions?
> 
> I don't find calling __init__() too ugly, especially if there's a
> comment explaining why.

That's probably the right answer.

For future reference, "# check-code-ignore" should ignore individual
lines.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list