A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2017-November/150506.html below:

[Python-Dev] [python-committers] Enabling depreciation warnings feature code cutoff

[Python-Dev] [python-committers] Enabling depreciation warnings feature code cutoffSerhiy Storchaka storchaka at gmail.com
Mon Nov 13 05:33:00 EST 2017
12.11.17 03:47, Guido van Rossum пише:
> - In Python 3 code, using `\u` escapes in a b'...' literal gives 
> "DeprecationWarning: invalid escape sequence '\u'"
> 
> In both cases these warnings are currently only generated if you run 
> mypy with these warnings enabled, e.g. `python3 -Wd -m mypy <files>`. 
> But this means that mypy would start generating these by default if 
> those warnings were enabled everywhere by default (per Antoine's 
> preference). And while it's debatable whether they are useful, there 
> should at least be a way to turn them off (e.g. when checking Python 2 
> code that's never going to be ported).. Running mypy in the above way is 
> awkward; mypy would likely have to grow a new flag to control this.

It is hard to determine what category is better for this warnings: 
DeprecationWarning or SyntaxWarning. On one hand, SyntaxWarning looks 
more appropriate since the warning is generated by the Python parser. On 
other hand, numerous warnings can confuse end users of Python 
applications, and DeprecationWarning is silenced by default.

This warning is a special case. When it is converted to an error, it 
becomes a SyntaxError, because the latter contains information about 
location of an invalid escape sequence, and produces better error report 
(containing source line, cursor, etc).

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4