Pythonでファイルのエンコードを宣言するとき
# -*- coding: utf-8 -*-
こういった内容を記載する人が多いと思いますが、自分にはこの記法には疑問がありました。
なぜEmacsを使わない人たちがEmacsのエンコードを宣言をするのだろうか。
会社ではEmacsを使うのは自分だけなので、もしかしたらこの記法がPythonのエンコード宣言だと思っているのかもしれません。
Vimではこう書く(らしい)です(Vimはほぼ使わないので知りません
# vim:fileencoding=<encoding-name>
Pythonのリファレンス 英文
If a comment in the first or second line of the Python script matches the regular expression coding[=:]\s*([-\w.]+), this comment is processed as an