Re: [RFC/PATCH] CodingGuidelines: add Python code guidelines

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [RFC/PATCH] CodingGuidelines: add Python code guidelines

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:55:49

John Keeping [off-list ref] writes:
On Fri, Jan 18, 2013 at 12:25:34PM -0800, Junio C Hamano wrote:
quoted
John Keeping [off-list ref] writes:
quoted
As more people have started trying to support Python 3 in the wild, it
has become clear that it is often easier to have a single codebase that
works with both Python 2 and Python 3, and not use 2to3.

It is for this reason that the Unicode literal prefix was reintroduced.
Yes, and from that perspective, placing floor on earlier 3.x makes
tons of sense, no?

These early versions may not be unstable in the "this does not
behave as specified in the language specification for 3.x" sense,
but for the purpose of running scripts meant to be executable by
both 2.x and 3.x series, the early 3.x versions are not as good as
later versions where Python folks started making deliberate effort
to support them.
As far as I'm aware (and having reviewed the release notes for 3.1, 3.2
and 3.3 as well as the planned features for 3.4), Unicode literals are
the only feature to have been added that was intended to make it easier
to support Python 2 and 3 in the same codebase.
So there may be some other incompatibility lurking that we may run
into later?
Given that no code currently on pu uses Unicode literals, I don't see a
reason to specify a minimum version of Python 3 since we're already
restricting ourselves to features in 2.6.
OK, at least that reasoning need to be kept somewhere, either in the
documentation of in the log message.

Thanks.

Re: [RFC/PATCH] CodingGuidelines: add Python code guidelines

From: John Keeping <hidden>
Date: 2016-06-15 22:55:49

On Fri, Jan 18, 2013 at 02:26:06PM -0800, Junio C Hamano wrote:
John Keeping [off-list ref] writes:
quoted
On Fri, Jan 18, 2013 at 12:25:34PM -0800, Junio C Hamano wrote:
quoted
These early versions may not be unstable in the "this does not
behave as specified in the language specification for 3.x" sense,
but for the purpose of running scripts meant to be executable by
both 2.x and 3.x series, the early 3.x versions are not as good as
later versions where Python folks started making deliberate effort
to support them.
As far as I'm aware (and having reviewed the release notes for 3.1, 3.2
and 3.3 as well as the planned features for 3.4), Unicode literals are
the only feature to have been added that was intended to make it easier
to support Python 2 and 3 in the same codebase.
So there may be some other incompatibility lurking that we may run
into later?
I doubt it - enough projects are running on Python 2 and 3 now that I
doubt there's anything unexpected left to hit.
quoted
Given that no code currently on pu uses Unicode literals, I don't see a
reason to specify a minimum version of Python 3 since we're already
restricting ourselves to features in 2.6.
OK, at least that reasoning need to be kept somewhere, either in the
documentation of in the log message.
I'll put it in the log message when I send this as a proper patch.


John
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help