[Python-ideas] parameter omit

Aaron Brady castironpi at comcast.net
Wed May 9 23:50:10 CEST 2007


No, still not uniform.  Cases might be rare, even syntactic sugar maybe.
if something huge:
	b=<def>
more huge
if something else:
	b=mything
still more
f(a,b,c).

-----Original Message-----
From: Josiah Carlson [mailto:jcarlson at uci.edu] 
Sent: Wednesday, May 09, 2007 4:51 PM
To: Aaron Brady; python-ideas at python.org
Subject: Re: [Python-ideas] parameter omit


"Aaron Brady" <castironpi at comcast.net> wrote:
> 
> Actually, I wanted a uniform way to call f.  f(a,b,c) for both cases if b
> can equal <def>.

f(a, b=...) #default c
f(a, c=...) #default b


 - Josiah

> -----Original Message-----
> From: Steven Bethard [mailto:steven.bethard at gmail.com] 
> Sent: Wednesday, May 09, 2007 3:45 PM
> To: Aaron Brady
> Cc: python-ideas at python.org
> Subject: Re: [Python-ideas] parameter omit
> 
> On 5/9/07, Aaron Brady <castironpi at comcast.net> wrote:
> > Is it possible to signal to a parameter to use its default?
> >
> > def f( a, b=None, c='' ):...
> >
> > f( 123, <def>, 'abc' )
> > f( 123, ObjA, <def> )
> 
> In this case, it's pretty easy::
> 
>     f(123, c='abc')
>     f(123, ObjA)
> 
> STeVe
> -- 
> I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a
> tiny blip on the distant coast of sanity.
>         --- Bucky Katt, Get Fuzzy
> 
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas




More information about the Python-ideas mailing list