Paul Rubin <http://[EMAIL PROTECTED]> wrote:

> Dave Benjamin <[EMAIL PROTECTED]> writes:
> > Can we get a show of hands for all of those who have written or are
> > currently maintaining code that uses the leaky listcomp "feature"?
> 
> It's really irrelevant whether anyone is using a feature or not.  If
> the feature is documented as being available, it means that removing
> it is an incompatible change that can break existing code which
> currently conforms to the spec.  If the "feature" is described as the
> bug that it is, anything that relies on it is nonconformant.
> 
> I do remember seeing some cute tricks (i.e. capable of becoming
> idioms) that depend on the leakage.

Sure, ``if [mo for mo in [myre.search(line)] if mo]: use(mo)`` and the
like, used to simulate assign-and-test.  No doubt maintaining backwards
compat with this kind of horrors means listcomps need to keep leaking
until Python 3.0, alas.  But hopefully no farther...


Alex
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to