Re: Function to apply superset of arguments to a function

2009-09-09 Thread Carl Banks
On Sep 9, 8:14 pm, Steven D'Aprano wrote: > On Wed, 09 Sep 2009 14:58:22 -0700, Carl Banks wrote: > > Use case seems perfectly obvious to me.  You have a set of functions > > that use different strategies to accomplish a task, and there is a lot > > of overlap in the arguments used but no consiste

Re: Function to apply superset of arguments to a function

2009-09-09 Thread Steven D'Aprano
On Wed, 09 Sep 2009 14:58:22 -0700, Carl Banks wrote: > Use case seems perfectly obvious to me. You have a set of functions > that use different strategies to accomplish a task, and there is a lot > of overlap in the arguments used but no consistency. You want to be > able to swap in different f

Re: Function to apply superset of arguments to a function

2009-09-09 Thread Carl Banks
On Sep 9, 9:45 am, Andrey Fedorov wrote: > Hi all, > > I've written a function [1] called apply_some which takes a set of > keywords arguments, filters only those a function is expecting, and > calls the function with only those arguments. This is meant to > suppress TypeErrors - a way to abstract

Re: Function to apply superset of arguments to a function

2009-09-09 Thread Carl Banks
On Sep 9, 11:47 am, 7stud wrote: > On Sep 9, 10:45 am, Andrey Fedorov wrote: > > > > > > > Hi all, > > > I've written a function [1] called apply_some which takes a set of > > keywords arguments, filters only those a function is expecting, and > > calls the function with only those arguments. Thi

Re: Function to apply superset of arguments to a function

2009-09-09 Thread Carl Banks
On Sep 9, 10:40 am, David Stanek wrote: > On Wed, Sep 9, 2009 at 12:45 PM, Andrey Fedorov wrote: > > Hi all, > > > I've written a function [1] called apply_some which takes a set of > > keywords arguments, filters only those a function is expecting, and > > calls the function with only those argum

Re: Function to apply superset of arguments to a function

2009-09-09 Thread David Stanek
On Wed, Sep 9, 2009 at 5:03 PM, Mel wrote: > David Stanek wrote: >> On Wed, Sep 9, 2009 at 12:45 PM, Andrey Fedorov >> wrote: > >>> I've written a function [1] called apply_some which takes a set of >>> keywords arguments, filters only those a function is expecting, and >>> calls the function with

Re: Function to apply superset of arguments to a function

2009-09-09 Thread Mel
David Stanek wrote: > On Wed, Sep 9, 2009 at 12:45 PM, Andrey Fedorov > wrote: >> I've written a function [1] called apply_some which takes a set of >> keywords arguments, filters only those a function is expecting, and >> calls the function with only those arguments. This is meant to >> suppress

Re: Function to apply superset of arguments to a function

2009-09-09 Thread 7stud
On Sep 9, 10:45 am, Andrey Fedorov wrote: > Hi all, > > I've written a function [1] called apply_some which takes a set of > keywords arguments, filters only those a function is expecting, and > calls the function with only those arguments. This is meant to > suppress TypeErrors - a way to abstrac

Re: Function to apply superset of arguments to a function

2009-09-09 Thread Andrey Fedorov
When a web request is made, my Django views are called with argument `user_id' present if someone is logged in, and set to None if the request is anonymous. The response varies based on this argument - someone pulling a team's information will get their relationship to the team if they are logged i

Re: Function to apply superset of arguments to a function

2009-09-09 Thread David Stanek
On Wed, Sep 9, 2009 at 12:45 PM, Andrey Fedorov wrote: > Hi all, > > I've written a function [1] called apply_some which takes a set of > keywords arguments, filters only those a function is expecting, and > calls the function with only those arguments. This is meant to > suppress TypeErrors - a wa

Function to apply superset of arguments to a function

2009-09-09 Thread Andrey Fedorov
Hi all, I've written a function [1] called apply_some which takes a set of keywords arguments, filters only those a function is expecting, and calls the function with only those arguments. This is meant to suppress TypeErrors - a way to abstract the logic which checks what arguments a passed-in fu