This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients matrixise, terry.reedy, wlohu, xtreak
Date 2019-03-01.04:29:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1551414571.92.0.317768098585.issue36066@roundup.psfhosted.org>
In-reply-to
Content
Syntax changes need PEPs.  By default, syntax changes are rejected.  This is especially true for new keywords, as any acceptible word will already be in use, and hence its introduction *will* break code.

We are still having issues over having temporarily made 'async' and 'await' 'semi-keywords' (for 2 versions) to smooth out breakage.  So new keywords must enable something previously difficult.  But implementing the 'empty' idea is fairly trivial, as demonstrated in the initial post.

A third alternative is a peak(iterator) class with a __bool__ method.  I posted one once, probably on python-list.  But the extra overhead every iteration must be larger than the simple assignment, which is so fast one should not worry about it.  I suspect the flag also beats the chain alternative.
---

[More opinionated than the above ...]

Calling what is easy and works today 'non-idiomatic' is nearly pure opinion and not persuasive as a rhetorical device.

The complicated rules for else-never interaction to be far more 'anti-idiomatic' from a comprehension point of view.  In any case, a flag allows easy, flexible, and precise ordering of never, something, and either-way code.
History
Date User Action Args
2019-03-01 04:29:31terry.reedysetrecipients: + terry.reedy, matrixise, xtreak, wlohu
2019-03-01 04:29:31terry.reedysetmessageid: <1551414571.92.0.317768098585.issue36066@roundup.psfhosted.org>
2019-03-01 04:29:31terry.reedylinkissue36066 messages
2019-03-01 04:29:31terry.reedycreate