thautwarm <yaoxiansa...@gmail.com> added the comment:
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 ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue34850> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com