Message358680
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 |
|
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 | |
|