From 1b59b6826ac765bf6a9ab35dd4b5ef91db8993ec Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sun, 29 May 2016 05:07:50 -0700 Subject: [PATCH] docs/code-style.rst: Update and clarify shebang rules. --- docs/code-style.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/code-style.rst b/docs/code-style.rst index d003c8fc29..e51bf8e9cf 100644 --- a/docs/code-style.rst +++ b/docs/code-style.rst @@ -352,11 +352,13 @@ styles (separate lines for each selector):: Python ------ -- Scripts should start with ``#!/usr/bin/env python2.7`` and not - ``#!/usr/bin/env python2.7``. See commit ``437d4aee`` for an explanation of - why. Don't put such a line on a Python file unless it's meaningful to - run it as a script. (Some libraries can also be run as scripts, e.g. - to run a test suite.) +- Scripts should start with ``#!/usr/bin/env python`` and not + ``#/usr/bin/python`` (the right Python may not be installed at + /usr/bin) or ``#/usr/bin/env/python2.7`` (bad for Python 3 + compatibility). Don't put a shebang line on a Python file unless + it's meaningful to run it as a script. (Some libraries can also be + run as scripts, e.g. to run a test suite.) + - The first import in a file should be ``from __future__ import absolute_import``, per `PEP 328 `__