Re: trapping errors in function call syntax

2006-02-13 Thread Duncan Booth
Fredrik Lundh wrote: > Avi Kak wrote: >> Suppose I write a function that I want to be called >> with ONLY keyword argumnts, how do I raise an >> exception should the function get called with >> what look like position-specfic arguments? > > here's one way to do it: > def func(*args, **kw): >

Re: trapping errors in function call syntax

2006-02-13 Thread Fredrik Lundh
Andrew Gwozdziewycz wrote: > While we're at it... Can someone point me to either an old post, or > documentation about tuple expansion with * ? I recently saw it used > and was shocked as i had no clue what it really did. I didn't know it > could be used outside of function definitions. the refer

Re: trapping errors in function call syntax

2006-02-13 Thread Tim Hochberg
Avi Kak wrote: > Hello: > >Suppose I write a function that I want to be called >with ONLY keyword argumnts, how do I raise an > exception should the function get called with > what look like position-specfic arguments? > > Any help would be appreciated. Say you want the signature

Re: trapping errors in function call syntax

2006-02-13 Thread Andrew Gwozdziewycz
While we're at it... Can someone point me to either an old post, or documentation about tuple expansion with * ? I recently saw it used and was shocked as i had no clue what it really did. I didn't know it could be used outside of function definitions. On 2/13/06, Fredrik Lundh <[EMAIL PROTECTED]>

Re: trapping errors in function call syntax

2006-02-13 Thread Fredrik Lundh
Avi Kak wrote: > Suppose I write a function that I want to be called > with ONLY keyword argumnts, how do I raise an > exception should the function get called with > what look like position-specfic arguments? here's one way to do it: >>> def func(*args, **kw): ... def myrealfunc(a=1, b=2, c

Re: trapping errors in function call syntax

2006-02-13 Thread Carsten Haese
On Mon, 2006-02-13 at 14:13, Avi Kak wrote: > Hello: > >Suppose I write a function that I want to be called >with ONLY keyword argumnts, how do I raise an > exception should the function get called with > what look like position-specfic arguments? > > Any help would be appreciated.

trapping errors in function call syntax

2006-02-13 Thread Avi Kak
Hello: Suppose I write a function that I want to be called with ONLY keyword argumnts, how do I raise an exception should the function get called with what look like position-specfic arguments? Any help would be appreciated. Avi Kak -- http://mail.python.org/mailman/listinfo/pyth