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/2010-July/102046.html below:

[Python-Dev] Use of coding cookie in 3.x stdlib

[Python-Dev] Use of coding cookie in 3.x stdlib [Python-Dev] Use of coding cookie in 3.x stdlibAlexander Belopolsky alexander.belopolsky at gmail.com
Mon Jul 19 01:21:10 CEST 2010
I was looking at the inspect module and noticed that it's source
starts with "# -*- coding: iso-8859-1 -*-".   I have checked and there
are no non-ascii characters in the file.   There are several other
modules that still use the cookie:

Lib/ast.py:# -*- coding: utf-8 -*-
Lib/getopt.py:# -*- coding: utf-8 -*-
Lib/inspect.py:# -*- coding: iso-8859-1 -*-
Lib/pydoc.py:# -*- coding: latin-1 -*-
Lib/shlex.py:# -*- coding: iso-8859-1 -*-
Lib/encodings/punycode.py:# -*- coding: utf-8 -*-
Lib/msilib/__init__.py:# -*- coding: utf-8 -*-
Lib/sqlite3/__init__.py:#-*- coding: ISO-8859-1 -*-
Lib/sqlite3/dbapi2.py:#-*- coding: ISO-8859-1 -*-
Lib/test/bad_coding.py:# -*- coding: uft-8 -*-
Lib/test/badsyntax_3131.py:# -*- coding: utf-8 -*-

I understand that coding: utf-8 is strictly redundant in 3.x.  There
are cases such as Lib/shlex.py where using encoding other than utf-8
is justified.  (See
http://svn.python.org/view?view=rev&revision=82560).  What are the
guidelines for other cases?  Should redundant cookies be removed?
Since not all editors respect the  -*- cookie, I think the answer
should be "yes" particularly when the cookie is setting encoding other
than utf-8.
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