From: Junio C Hamano <gitster@pobox.com>
To: John Keeping <john@keeping.me.uk>
Cc: git@vger.kernel.org, "Eric S. Raymond" <esr@thyrsus.com>,
Felipe Contreras <felipe.contreras@gmail.com>,
Pete Wyckoff <pw@padd.com>,
Michael Haggerty <mhagger@alum.mit.edu>
Subject: Re: [RFC/PATCH] CodingGuidelines: add Python code guidelines
Date: Fri, 18 Jan 2013 11:04:15 -0800 [thread overview]
Message-ID: <7vvcauqpn4.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20130118180639.GD31172@serenity.lan> (John Keeping's message of "Fri, 18 Jan 2013 18:06:39 +0000")
John Keeping <john@keeping.me.uk> writes:
> diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
> index 69f7e9b..baf3b41 100644
> --- a/Documentation/CodingGuidelines
> +++ b/Documentation/CodingGuidelines
> @@ -179,6 +179,22 @@ For C programs:
> - Use Git's gettext wrappers to make the user interface
> translatable. See "Marking strings for translation" in po/README.
>
> +For Python scripts:
> +
> + - We follow PEP-8 (http://www.python.org/dev/peps/pep-0008/).
> +
> + - As a minimum, we aim to be compatible with Python 2.6 and 2.7.
> +
> + - Where required libraries do not restrict us to Python 2, we try to
> + also be compatible with Python 3. In this case we use
> + `from __future__ import unicode_literals` if we need to differentiate
> + Unicode string literals, rather than prefixing Unicode strings with
> + 'u' since the latter is not supported in Python versions 3.0 - 3.2.
"In this case"? In what case? This document will stay effective
long after you settle one particular backward incompatibility Python
3 introduced, namely, the unicode literal issues. It is just one
"example".
That example somehow tells me that early versions of Python 3.x
series may be too buggy and not worth worrying about, and we may
want to set a floor for Python 3.x series, too, with something
like:
- The code should be compatible with 2.6 and newer versions of
Python 2.x series; 2.5 and older are not supported anymore.
- The code should also be comptabile with 3.2 and newer versions
of Python 3.x series; 3.1 and older are not mature enough and
have too many problems to write scripts that work on it and
solid 2.x at the same time.
I am not actively advocating to disqualify early 3.x; I am just
suggesting that doing so may be a viable escape hatch for us that
does not harm real users. If you and others who know Python better
think there isn't any problem that makes it too cumbersome to
support both late 2.x and 3.0/3.1, there is no reason to set the
floor at 3.2.
I just have this feeling that we might be better off treating them
as 0.x releases of a new software called Python3, that happens to be
similar to the Python we know.
next prev parent reply other threads:[~2013-01-18 19:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-18 18:06 [RFC/PATCH] CodingGuidelines: add Python code guidelines John Keeping
2013-01-18 19:04 ` Junio C Hamano [this message]
2013-01-18 19:35 ` John Keeping
2013-01-18 20:25 ` Junio C Hamano
2013-01-18 22:05 ` John Keeping
2013-01-18 22:26 ` Junio C Hamano
2013-01-18 23:05 ` John Keeping
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vvcauqpn4.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=esr@thyrsus.com \
--cc=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
--cc=john@keeping.me.uk \
--cc=mhagger@alum.mit.edu \
--cc=pw@padd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.