[code-quality] Bad coding style?

Ned Batchelder ned at nedbatchelder.com
Fri Feb 7 22:38:16 CET 2014


On 2/6/14 1:51 PM, Thomas Heller wrote:
> I sometimes have code like this:
>
> class Foo:
>
>     def spam(self):
>         ....
>
>     from somewhere import method
>     from somewhere import CONSTANT
>
>     def blah(self):
>         ....
>
> where CONSTANT defines a class attribute, anbd method
> is a method that I would like to call like any other
> methor (self.spam(), or self.blah()).
>
> This works nicely and is a compact coding style, however
> frosted complains about unused imports.
>
> Should I fix my coding habits, or should frosted by fixed?

This is a very unusual coding style, one that many people would object 
to.  But more importantly, how could frosted be fixed to know that these 
are used?

--Ned.
>
> Thanks,
> Thomas
>
>
>
>
> _______________________________________________
> code-quality mailing list
> code-quality at python.org
> https://mail.python.org/mailman/listinfo/code-quality



More information about the code-quality mailing list