pychecker too self-centric?
Neal Norwitz
neal at metaslash.com
Tue Feb 4 12:09:25 EST 2003
On Tue, 04 Feb 2003 10:39:16 -0500, Michele Simionato wrote:
> I have just downloaded pychecker (version 0.8.12) and discovered that it
> is a little too much self-centric for my taste.
Let's call it like it is: PyChecker is just too self-centric. :-)
I consider the lack of support for metaclasses, etc. to be a bug.
> class inch(float): #Guido's example
> "Convert from inch to meter."
> def __new__(cls, arg=0.0):
> return float.__new__(cls, arg*0.0254)
>
> Pychecker will complain since the first argument of '__new__' is 'cls'
> and not 'self':
That should be considered a bug.
> In general, I think pychecker should be able to distinguish static methods
> (and class methods, where the first argument should be called 'cls')
> from traditional methods. Is this going to happen in a future version?
Thanks to the time machine, it does. :-) Use the version in cvs.
> In addition, it would be nice if pychecker could distinguish methods in
> a normal class from methods in a metaclass. The first argument for a
> method in a metaclass should be 'cls', not 'self'. I mean, in principle
> it is perfectly correct to call it 'self', since at the very end a
> metaclass *is* a class, but still I think that calling it 'cls' enhances
> a lot the clarity and avoids any possible confusion.
I don't use metaclasses, I don't know what the conventions are or should
be.
Bug reports welcome, patches preferred.
Regards,
Neal
More information about the Python-list
mailing list