git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: Yann Dirson <ydirson@altern.org>
Cc: "Luiz Fernando N. Capitulino" <lcapitulino@gmail.com>,
	git@vger.kernel.org, "Shawn O. Pearce" <spearce@spearce.org>
Subject: Re: [ANNOUNCE]: PyGit and libgit-thin
Date: Wed, 25 Jul 2007 21:57:59 +0200	[thread overview]
Message-ID: <85odi08ddk.fsf@lola.goethe.zz> (raw)
In-Reply-To: <20070725195010.GA30277@nan92-1-81-57-214-146.fbx.proxad.net> (Yann Dirson's message of "Wed\, 25 Jul 2007 21\:50\:10 +0200")

Yann Dirson <ydirson@altern.org> writes:

> I had a quick look at the current pygit API (as described in the
> README), and I find the current revlist one somewhat confusing.  Why
> using post-contructor methods, and not using named args in the
> constructor itself ?
>
> That is, the example reading:
>
>>>> rv = repo.revlist()
>>>> rv.include('8d9107e8c50e1c4ff43c91c8841805833f3ecfb9')
>>>> rv.count = 10
>>>> rv.show_merges()
>>>> for commit in rv:
> ...  print commit.id()
> ... 
>
>
> would be IMHO much nicer to use as:
>
>>>> rv = repo.revlist(include=('8d9107e8c50e1c4ff43c91c8841805833f3ecfb9'),
> ...                   count = 10,
> ...                   show_merges = true)
> ...
>>>> for commit in rv:
> ...  print commit.id()
> ... 
>
>
> What do you think ?

Nicer to use if the commands and their options originate from withing
Python.  But if Python parses arguments from somewhere else and passes
them on, the former interface leads to much cleaner code AFAICS.
Pasting together a named argument call piecemeal is not going to be
pretty, I should think.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

  reply	other threads:[~2007-07-25 19:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-23 12:35 [ANNOUNCE]: PyGit and libgit-thin Luiz Fernando N. Capitulino
2007-07-25 19:50 ` Yann Dirson
2007-07-25 19:57   ` David Kastrup [this message]
2007-07-25 21:21     ` Jan Hudec
2007-07-25 20:55   ` Luiz Fernando N. Capitulino

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85odi08ddk.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=git@vger.kernel.org \
    --cc=lcapitulino@gmail.com \
    --cc=spearce@spearce.org \
    --cc=ydirson@altern.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).