| Store | Cart

Anonymus functions revisited

From: George Sakkis <gsak...@rutgers.edu>
Fri, 25 Mar 2005 17:09:38 -0500
"Ron_Adam" <radam2 at tampabay.rr.com> wrote:

> On 25 Mar 2005 10:09:50 GMT, Duncan Booth> <duncan.booth at invalid.invalid> wrote:>>> >I've never found any need for an is_defined function. If in doubt I just> >make sure and initialise all variables to a suitable value before use.> >However, I'll assume you have a good use case.>> I admit that that is the better practice.  George's example was the> conversion of data from one form to another where the data is mixed> with complete and incomplete items.  And Kay is looking at tuple> unpacking.>> It's hard to beat try/except for these situations though. :)

I posted a recipe in python cookbook
(http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/392768) for the subproblem I was interested
in initially (variable-length iterable unpacking), and I prefer it over explicit try/except (but of
course I'm biased :-)). Kay is proposing something even more general and powerful, and it will be
interesting to see if all this brainstorming can be brought forward more 'formally', e.g. at a PEP
or pre-PEP level.

Regards,
George

Recent Messages in this Thread
Ron_Adam Mar 25, 2005 06:00 pm
George Sakkis Mar 25, 2005 10:09 pm
Ron Mar 24, 2005 05:38 pm
Duncan Booth Mar 25, 2005 10:09 am
Ron Mar 23, 2005 10:41 pm
Duncan Booth Mar 24, 2005 09:20 am
Ron Mar 22, 2005 10:27 pm
George Sakkis Mar 22, 2005 11:15 pm
Ron Mar 23, 2005 02:11 am
bruno modulix Mar 23, 2005 09:50 am
Duncan Booth Mar 23, 2005 10:13 am
Kay Schluehr Mar 23, 2005 11:43 am
Ron Mar 23, 2005 01:41 pm
Kay Schluehr Mar 23, 2005 02:31 pm
Duncan Booth Mar 23, 2005 02:47 pm
Ron Mar 23, 2005 02:26 pm
bruno modulix Mar 23, 2005 09:44 am
Messages in this thread