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/2016-March/143513.html below:

[Python-Dev] What does a double coding cookie mean?

[Python-Dev] What does a double coding cookie mean? [Python-Dev] What does a double coding cookie mean?Serhiy Storchaka storchaka at gmail.com
Wed Mar 16 03:09:08 EDT 2016
On 16.03.16 08:34, Glenn Linderman wrote:
>  From the PEP 263:
>
>> More precisely, the first or second line must match the regular
>>     expression "coding[:=]\s*([-\w.]+)". The first group of this
>>     expression is then interpreted as encoding name. If the encoding
>>     is unknown to Python, an error is raised during compilation. There
>>     must not be any Python statement on the line that contains the
>>     encoding declaration.
>
> Clearly the regular expression would only match the first of multiple
> cookies on the same line, so the first one should always win... but
> there should only be one, from the first PEP quote "a magic comment".

"The first group of this expression" means the first regular expression 
group. Only the part between parenthesis "([-\w.]+)" is interpreted as 
encoding name, not all expression.


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