[Python-ideas] Idea: Lazy ... statement

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Oct 15 01:53:25 CEST 2008


Jim Jewett wrote:

> Since this can be (awkwardly) done now, I don't think the problem is
> big enough for another keyword.

Yes, it can be done, but not without confounding static
analysis tools. That's the reason I'm suggesting a
dedicated syntax.

An alternative would be to establish a convention for
expressing it that static tools could recognize, although
it's hard to think of something that wouldn't look
ugly.

>     def setdefault(self, k, lazy d=None): ...
> 
> or even
> 
>     lazy def yikes(msg):

I'm calling hypergeneralization on these -- they would
be doing very different things from what I'm suggesting.

-- 
Greg



More information about the Python-ideas mailing list