New submission from Jakub Wilk:

If the encoding is declared on the second line, the first line must not contain 
anything except comments. However, this fact is not documented.

The Python Language reference says only that "the encoding declaration must 
appear on a line of its own";
and PEP 263 says only that "there must not be any Python statement on the line 
that contains the encoding declaration".

For example, Python ignores this encoding declaration:

spam = True
# encoding=ISO-8859-2

despite the fact that it appears on a line of its own.

----------
assignee: docs@python
components: Documentation
messages: 245946
nosy: docs@python, jwilk
priority: normal
severity: normal
status: open
title: please document that no code preceding encoding declaration is allowed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24531>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to