Re: [RFCv3 2/4] Add Python support library for CVS remote helper
- From
Johan Herland <johan@herland.net>
- Date
- Aug 13, 2009, 01:27 UTC
- Message-ID
- <200908130327.28571.johan@herland.net>
- In-Reply-To
- <7vzla4r0qc.fsf@alter.siamese.dyndns.org>
On Thursday 13 August 2009, Junio C Hamano wrote:
Show 29 quoted lines
> David Aguilar <davvid@gmail.com> writes: > > This also had me wondering about the following: > > git uses tabs for indentation > > Not relevant. That is a rule for our "C" source code. We also use it in > our Perl scripts and shell scripts because there is no single "one right > way" that is strongly defined and everybody adheres to, like the 4-space > rule Python folks have. > > > BUT, the python convention is to use 4-space indents ala PEP-8 > > http://www.python.org/dev/peps/pep-0008/ > > > > It might be appealing to when-in-Rome (Rome being Python) here > > and do things the python way when we code in Python. > > Yes, this is more important. > > >> + if len(msg) > 25: msg = msg[:22] + "..." # Max 25 chars long > >> + return "<Changeset @(%s) by %s (%s) updating %i files>" % ( > >> + self.date, self.author, msg, len(self.revs)) > > > > Similar to the git coding style, this might be better written: > > So is this one. If experienced Python folks also frown on single-line > conditionals, then by all means please update this. But if this > suggestion is solely because we don't do a single-line conditional in our > C source code, then please do not insist on it too strongly. The code > should look familiar to Pythonistas with good tastes (if such a class of > people exist, that is ;-)).
Ok. Thanks. I will follow PEP8 as closely as possible, including the 4-space indent.
...Johan
-- Johan Herland, <johan@herland.net> www.herland.net