On 11 octobre 09:59, Stefan Parviainen wrote: > Hi all, Hi, > I have a situation where in a module I have a function that creates classes > like this (obviously the real deal is more complicated than this) > > def foo_maker(x): > class _Foo: > def bar(self): print x > return _Foo > > I also want to have a "default version" of the class in the module: > Foo = foo_maker(0) > > so that a user can do: > import mymodule > x = Foo() > x.bar() > > However, pylint thinks that Foo is a constant in the module (which it kind of > is ...) and wants it to be written in all upper case. That doesn't make much > sense in this case though (x = FOO() looks wrong in so many ways). Is there > any way to tell pylint to use the naming convention for classes even if > something looks like a constant, preferably only in this one case?
there is no such feature yet. You can still file a ticket on the project's tracker. -- Sylvain Thénault LOGILAB, Paris (France) Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations Développement logiciel sur mesure: http://www.logilab.fr/services CubicWeb, the semantic web framework: http://www.cubicweb.org _______________________________________________ Python-Projects mailing list [email protected] http://lists.logilab.org/mailman/listinfo/python-projects
