Message358680
| Author | thautwarm |
|---|---|
| Recipients | Anthony Sottile, ammar2, barry, brett.cannon, jwilk, miss-islington, nascheme, njs, rhettinger, serhiy.storchaka, steven.daprano, thautwarm, xiang.zhang |
| Date | 2019-12-19.13:39:17 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1576762758.0.0.000530704653187.issue34850@roundup.psfhosted.org> |
| In-reply-to |
| Content | |
|---|---|
Thanks.
However, unfortunately, this warning seems impossible to suppress.
Use following example:
import warnings
warnings.filterwarnings('ignore')
warnings.warn(SyntaxWarning("test"))
def f(x):
return x is 5
print(f(5))
I succeeded in suppressing my own SyntaxWarning("test") , but the output is still:
python a.py
a.py:7: SyntaxWarning: "is" with a literal. Did you mean "=="?
return x is 5
True |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2019-12-19 13:39:18 | thautwarm | set | recipients: + thautwarm, barry, brett.cannon, nascheme, rhettinger, jwilk, steven.daprano, njs, serhiy.storchaka, xiang.zhang, Anthony Sottile, ammar2, miss-islington |
| 2019-12-19 13:39:18 | thautwarm | set | messageid: <1576762758.0.0.000530704653187.issue34850@roundup.psfhosted.org> |
| 2019-12-19 13:39:17 | thautwarm | link | issue34850 messages |
| 2019-12-19 13:39:17 | thautwarm | create | |