New submission from Terry J. Reedy <[EMAIL PROTECTED]>: Filter() allows None as a stand-in for either the still-nonexistent identity() or the now existent bool(). Removing the now redundant option would slightly simplify the language. It is certainly a glitch for newcomers. Would this option be included if filter were being added now?
Fixer: I should think filter(None,it) => filter(bool,it) should be sufficient as I expect filter(f_f_exp, it), where f_f_exp is a filter function expression that sometimes gives None, should be fairly rare. Efficiency: filter() could (if it does not now) avoid calling bool twice internally by checking for bool instead of None). Even if removing None is rejected, filter should also check for bool (if it does not now) to not penalize those who write the obvious filter(bool,it). If this item is rejected, turn it into a doc item for PEP3099. ---------- components: Interpreter Core messages: 66219 nosy: tjreedy severity: normal status: open title: Bool makes filter(None,it) redundant; remove None option? type: behavior versions: Python 3.0 __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2759> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com