[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PRELIMINARY PATCH] High-level Python "Client" layer API, mark zero

From: David James <djames_at_collab.net>
Date: 2006-07-10 19:42:31 CEST

On 7/10/06, Max Bowsher <maxb1@ukf.net> wrote:
> > +def _get_poolarg(pool):
> > + """Returns an empty tuple if pool is None, or (pool,) otherwise, for use in
> > + functions taking an optional pool parameter."""
> > + if pool is None:
> > + return ()
> > + else:
> > + return (pool,)
> ...
> > + def mkdir(self, paths, pool = None):
> > + poolarg = core._get_poolarg(pool)
> > + return mkdir2(paths, self.ctx, *poolarg)
> ...
>
> This poolarg stuff seems a little messy - perhaps we should instead
> adjust the underlying wrapper code to understand None directly, rather
> than insisting on the presence/absence of the pool parameter.

There's no need to change our wrappers. If 'pool = None', we treat the
pool argument as missing. Therefore, the above snippet can be
simplified to:
  def mkdir(self, paths, pool = None):
    return mkdir2(paths, self.ctx, pool)

Cheers,

David

-- 
David James -- http://www.cs.toronto.edu/~james
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jul 10 19:42:59 2006

This is an archived mail posted to the Subversion Dev mailing list.