I'm a bit confused as to why folks are making
pronouncements about their support for this PEP before it's
even finished, but, oh well.
As for what seems like one major issue:
Yes, this is a kind of "deferred" evaluation, but it is
not a general purpose one, and that, I think, is the
strength of the proposal, it's small and specific, and, most
importantly, the scope in which the expression will be
evaluated is clear and simple. In contrast, a general
deferred object would, to me, be really confusing about what
scope it would get evaluated in -- I can't even imagine how
I would do that -- how the heck am I supposed to know what
names will be available in some function scope I pass this
thing into??? Also, this would only allow a single
expression, not an arbitrary amount of code -- if we're
going to have some sort of "deferred object" -- folks will
very soon want more than that, and want full deferred
function evaluation. So that really is a whole other kettle
of fish, and should be considered entirely separately.
As for inspect -- yes, it would be great for these
late-evaluated defaults to have a good representation there,
but I can only see that as opening the door to more
featureful deferred object, certainly not closing it.
-CHB
Christopher Barker, PhD (Chris)
Python Language Consulting
- Teaching
- Scientific Software Development
- Desktop GUI and Web Development
- wxPython, numpy, scipy, Cython