Author ncoghlan
Recipients Julian, dabeaz, doughellmann, ncoghlan, nedbat, r.david.murray, rhettinger, skrah, twouters
Date 2013-06-04.02:53:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1370314435.48.0.449376576017.issue18111@psf.upfronthosting.co.za>
In-reply-to
Content
To me, the Python-specific difference that makes this useful for us but not for others is *precisely* the fact that the simple idiom:

    x = min(seq) if seq else default

is broken for iterators that don't provide __len__ or __bool__, while the even simpler:

    x = min(seq)

is broken for the empty iterable.

However, I think we should explicitly disallow the combination of multiple positional arguments *and* the new default argument. If you don't know the length of the input iterable, you should *not* be using the multiple argument form.
History
Date User Action Args
2013-06-04 02:53:55ncoghlansetrecipients: + ncoghlan, twouters, rhettinger, nedbat, doughellmann, r.david.murray, skrah, dabeaz, Julian
2013-06-04 02:53:55ncoghlansetmessageid: <1370314435.48.0.449376576017.issue18111@psf.upfronthosting.co.za>
2013-06-04 02:53:55ncoghlanlinkissue18111 messages
2013-06-04 02:53:55ncoghlancreate