On Wed, Sep 7, 2011 at 10:28, Sylvain Thénault
<[email protected]>wrote:
> On 06 September 10:40, Torsten Marek wrote:
> > Hi all,
>
> Hi!
>
> > I'm sending a couple of patches that we wrote internally for our custom
> > extended pylint version. Some of the patches expose more configuration
> > options, other ones fix exotic crashes. I'll explain all of them
> separately.
> >
> > The patches were written for 0.23, but I've tested all of them against
> 0.24,
> > and updated them so they apply cleanly.
>
> This is great news! We have been waiting for backport from gpylint for a
> while :)
>
> > * classmethod_first_arg_name
>
> applied
>
> > * import_assign_crash
>
> applied. This one will please more than one :)
>
> > * infer__bases__
> > Fixes a bug with incorrectly inferring the base classes This led to a
> crash
> > in code like
> >
> > class X(some bases...)
> > def __init__(self, ...):
> > for b in self.__class__.__bases__:
> > # do sth with b
>
>
> This one is unclear to me. I fail to see what's changing beside cosmetic.
> If I revert to previous code and run the new test, everything still seems
> fine.
>
> This is a modified version of the code that originally triggered the crash:
class BaseClass(object):
def __init__(self):
pass
class SomeClass(BaseClass): def __init__(self): for base in
self.__class__.__bases__: # Avoid problems with diamond
inheritance. basekey = 'init_' + str(base) if not
hasattr(self, basekey): setattr(self, basekey, 1) else:
continue if hasattr(base, '__init__'):
base.__init__(self)
> * newstyle_type_fix
>
> applied
>
> > * nocatch_exception_types
>
> applied
>
> > * no_main_import
>
> applied
>
> > * no_special_attr_scop_lookup_crash
>
> applied
>
> > * str_getitem_infer_fix
>
> applied
>
> > The fixes for the crashes were all found while running gpylint over a
> > significant subset of the Python code at Google, the new configuration
> > options are needed to make gpylint adhere to our internal style guide,
> but
> > might be useful to others as well.
>
> Yeah, don't hesitate to send more :D All the patches were clean and tested,
> that's neat. I've only two minor remarks:
>
> * please use pylint coding style (eg indent with 4 spaces, not 2 :)
>
Sorry, Google house style must have crept into some of the patches. Emacs
unfortunately doesn't do autodetection of default indentation levels used in
a file, I'll see if I can fix that.
> * if you could link patches to tickets in the tracker (
> logilab.org/project/pylint
> or logilab.org/project/logilab-astng), it would be perfect.
>
I don't understand, should I do that for the patches I sent you, or do that
in the future?
// Torsten
--
Site Reliability Engineer ∘ Google ✚ ∘ ⬕
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects