I understand that Python 3.7 now issues DeprecationWarning for code entered in the interactive shell and also for single-module programs. I see this behaviour with:

C:\wrk> python
python 3.7.0 (v3.7.0:...
import imp
__main__:1: DeprecationWarning: the imp module is deprecated...

But if I use an unknown escape code, then the expected warning doesn't issue:

print('Hello \world')
Hello \world

But if I explicitly turn on default warnings, then I do get it:

C:\wrk> python -Wd
print('Hello \world')
<stdin>:1: DeprecationWarning: invalid escape sequence \w
Hello \world


Shouldn't I see the "invalid escape sequence" deprecation warning under 3.7 without having to turn on default warnings? They are both warnings of class DeprecationWarning. Am I not seeing something? Is this a bug?

I suspect it might have something to do with /when/ the warning is evaluated (parsing time vs runtime), but I'm not sure, and I'm not sure if that should be relevant to whether the warning is in fact raised. (I am aware of PEP 565)

Running CPython 3.7.0 on Windows 10, standard

Thanks for your insights.

Peter


--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to