[issue2759] Bool makes filter(None,it) redundant; remove None option?
Georg Brandl [EMAIL PROTECTED] added the comment: I don't think this is important enough to get into 3099. -- status: open - closed __ 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
[issue2759] Bool makes filter(None,it) redundant; remove None option?
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
[issue2759] Bool makes filter(None,it) redundant; remove None option?
Georg Brandl [EMAIL PROTECTED] added the comment: FYI, filter() already special-cases bool. I think the discussion whether to remove the None argument has been had, but I could be mistaken. Guido, do you remember more? -- assignee: - gvanrossum nosy: +georg.brandl, gvanrossum __ 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
[issue2759] Bool makes filter(None,it) redundant; remove None option?
Raymond Hettinger [EMAIL PROTECTED] added the comment: It was deferred to me and I decided to keep the None argument as this is the standard way of spelling a missing argument. Also, the None argument provides a pretty good clue that a special fast path is being taken. -- nosy: +rhettinger __ 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
[issue2759] Bool makes filter(None,it) redundant; remove None option?
Georg Brandl [EMAIL PROTECTED] added the comment: Okay, closing as won't fix. -- assignee: gvanrossum - resolution: - wont fix status: open - closed __ 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