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/143505.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?MRAB python at mrabarnett.plus.com
Tue Mar 15 17:23:33 EDT 2016
On 2016-03-15 20:53, MRAB wrote:
> On 2016-03-15 20:30, Guido van Rossum wrote:
>> I came across a file that had two different coding cookies -- one on
>> the first line and one on the second. CPython uses the first, but mypy
>> happens to use the second. I couldn't find anything in the spec or
>> docs ruling out the second interpretation. Does anyone have a
>> suggestion (apart from following CPython)?
>>
>> Reference: https://github.com/python/mypy/issues/1281
>>
> I think it should follow CPython.
>
> As I see it, CPython allows it to be on the second line because the
> first line might be needed for the shebang.
>
> If the first two lines both had an encoding, and then you inserted a
> shebang line, the second one would be ignored anyway.
>
A further thought: is mypy just assuming that the first line contains 
the shebang?

If there's only one encoding line, and it's the first line, does mypy 
still get it right?

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