[Python-Dev] Issue #26204: compiler now emits a SyntaxWarning on constant statement

Victor Stinner victor.stinner at gmail.com
Mon Feb 8 14:51:37 EST 2016


Le 8 févr. 2016 8:14 PM, "Guido van Rossum" <guido at python.org> a écrit :
> Hum. I'm not excited by this idea. It is not bad syntax.

Do you see an use case for "constant statements" other than strings and
ellipsis?

Such statement does nothing. Previously the compiler emited
LOAD_CONST+POP_TOP.

GCC also emits a warning on such code.

> Have you
> actually seen newbies who were confused by such things?

Well, not really. But I don't see any use case of such code except of
obvious mistakes. Sometimes such code appears after multiple refactoring
(and mistakes).

Are you suggesting to remove the warning?

Victor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20160208/263cd937/attachment.html>


More information about the Python-Dev mailing list