On 08 juillet 05:58, s...@pobox.com wrote:
> In this function pylint complains that a and b are unused:
> 
>     def f(a):
>         b = "some var"
>         return "%(a)s, %(b)s" % locals()
> 
> It would be nice if it noticed literal % locals() structure and treated
> variable references within the string as actual usage.

http://www.logilab.org/ticket/9839

In a more general way, pylint should have better understanding of interpolated
string (at least issue error on cases such as ::

 '%s' % (a, b)
 '%(key)s' % {'ke' : 'value'}

...

Would someone be aware of something to extract "interpolation data" from a 
string?
I've to admit I've not took the time to search for such thing...

-- 
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
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to