[issue26204] compiler: ignore constants used as statements (don't emit LOAD_CONST+POP_TOP)

2017-02-08 Thread STINNER Victor
STINNER Victor added the comment: FYI the thread was in February 2016: https://mail.python.org/pipermail/python-dev/2016-February/143163.html "[Python-Dev] Issue #26204: compiler now emits a SyntaxWarning on constant statement" -- ___ Python tracker

[issue26204] compiler: ignore constants used as statements (don't emit LOAD_CONST+POP_TOP)

2016-02-09 Thread Jim Jewett
Jim Jewett added the comment: I think the warning was helpful; it just had confusing wording. Instead of: """ >>> def f(): ... False ... :2: SyntaxWarning: ignore constant statement """ perhaps: """ >>> def f(): ... False ... :2: SyntaxWarning: ignoring constant statement """ or even: """

[issue26204] compiler: ignore constants used as statements (don't emit LOAD_CONST+POP_TOP)

2016-02-09 Thread STINNER Victor
STINNER Victor added the comment: Sorry you are late :-) I started a thread on python-dev and it was decided to let linters handle this warning. -- ___ Python tracker

[issue26204] compiler: ignore constants used as statements? (don't emit LOAD_CONST+POP_TOP)

2016-02-08 Thread STINNER Victor
STINNER Victor added the comment: changeset: 100192:4bdb21380743 tag: tip user:Victor Stinner date:Mon Feb 08 18:17:58 2016 +0100 files: Lib/test/test_ast.py Lib/test/test_code.py Lib/test/test_grammar.py Misc/NEWS Python/compile.c

[issue26204] compiler: ignore constants used as statements (don't emit LOAD_CONST+POP_TOP)

2016-02-08 Thread STINNER Victor
STINNER Victor added the comment: I changed my patch to emit a SyntaxWarning. If too many users complain of the warning, maybe we can remove it. IMHO it's useful to detect bugs. -- resolution: -> fixed status: open -> closed title: compiler: ignore constants used as statements? (don't

[issue26204] compiler: ignore constants used as statements? (don't emit LOAD_CONST+POP_TOP)

2016-02-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset a0d053899ff8 by Victor Stinner in branch 'default': Simplify main() of test_ast https://hg.python.org/cpython/rev/a0d053899ff8 New changeset bcf27fa55632 by Victor Stinner in branch 'default': Replace noop constant statement with expression

[issue26204] compiler: ignore constants used as statements (don't emit LOAD_CONST+POP_TOP)

2016-02-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 15531b10976c by Victor Stinner in branch 'default': compiler: don't emit SyntaxWarning on const stmt https://hg.python.org/cpython/rev/15531b10976c -- ___ Python tracker

[issue26204] compiler: ignore constants used as statements (don't emit LOAD_CONST+POP_TOP)

2016-02-08 Thread Georg Brandl
Georg Brandl added the comment: Shouldn't the message be "constant statement ignored"? The current wording reads strange to me. -- nosy: +georg.brandl ___ Python tracker

[issue26204] compiler: ignore constants used as statements (don't emit LOAD_CONST+POP_TOP)

2016-02-08 Thread John Mark Vandenberg
Changes by John Mark Vandenberg : -- nosy: +jayvdb ___ Python tracker ___ ___

[issue26204] compiler: ignore constants used as statements (don't emit LOAD_CONST+POP_TOP)

2016-02-08 Thread STINNER Victor
STINNER Victor added the comment: > Shouldn't the message be "constant statement ignored"? The current wording > reads strange to me. I removed the warning ;) -- ___ Python tracker

[issue26204] compiler: ignore constants used as statements? (don't emit LOAD_CONST+POP_TOP)

2016-02-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list

[issue26204] compiler: ignore constants used as statements? (don't emit LOAD_CONST+POP_TOP)

2016-01-26 Thread STINNER Victor
Changes by STINNER Victor : -- title: compiler: don't emit LOAD_CONST instructions for constant statements? -> compiler: ignore constants used as statements? (don't emit LOAD_CONST+POP_TOP) ___ Python tracker