git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH v2] CodingGuidelines: add Python coding guidelines

From
John Keeping <john@keeping.me.uk>
Date
Jan 29, 2013, 19:55 UTC
Message-ID
<20130129195534.GE1342@serenity.lan>
In-Reply-To
<7vzjzrokag.fsf@alter.siamese.dyndns.org>
On Tue, Jan 29, 2013 at 11:34:31AM -0800, Junio C Hamano wrote:
Show 25 quoted lines
> John Keeping <john@keeping.me.uk> writes:
> 
> > Changes since v1:
> >
> > - Set 3.1 as the minimum Python 3 version
> >
> > - Remove the section on Unicode literals - it just adds confusion and
> >   doesn't apply to the current code; we can deal with any issues if they
> >   ever arise.
> > ...
> > + - We use the 'b' prefix for bytes literals.  Note that even though
> > +   the Python documentation for version 2.6 does not mention this
> > +   prefix it is supported since version 2.6.0.
> 
> Do we still need to single out the 'b' prefix?  Even if it were
> necessary, I'd like to see it toned down a bit to make it clear that
> most of the time you can write strings as strings without having to
> worry about the "is it unicode string or a string string" mess.
> Like
> 
>     - When you must make distinction between Unicode literals and
>       byte string literals, it is OK to use 'b' prefix.  Even though
>       ...
> 
> perhaps?
Yeah, that's better.

I want to include it because if you look in the Python documentation then you'll be misled into thinking that it's not available on 2.6 and we will be supporting that for a while since it is the version included in RHEL 6.

John
Previous: Junio C HamanoNext: Michael Haggerty
Message 3 of 8 in “CodingGuidelines: add Python coding guidelines”
  1. CodingGuidelines: add Python coding guidelinesJohn Keeping, Jan 29, 2013
  2. Junio C HamanoJan 29, 2013
  3. John KeepingJan 29, 2013
  4. Michael HaggertyJan 30, 2013
  5. John KeepingJan 30, 2013
  6. Michael HaggertyFeb 1, 2013
  7. John KeepingFeb 1, 2013
  8. Pete WyckoffFeb 3, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.