On 03/26/2015 09:41 PM, Rustom Mody wrote:
On Thursday, March 26, 2015 at 11:30:57 AM UTC+5:30, Chris Angelico wrote:


Python 3.5.0a0 (default:4709290253e3, Jan 20 2015, 21:48:07)
[GCC 4.7.2] on linux

class filter(object)
  |  filter(function or None, iterable) --> filter object
  |
  |  Return an iterator yielding those items of iterable for which 
function(item)
  |  is true. If function is None, return the items that are true.
  |
  |  Methods defined here:

...

On a more specific note, its the 1st line:

class filter(object)

which knocks me off.
If a more restricted type from the ABC was shown which exactly captures all
the iterator-specific stuff like __iter__, __next__ it would sure help (me)


Since it's not actually derived from anything else, I'd leave that part alone. But it could be useful to add something like:

ducktype: collections.abc.Iterable

if nothing else, it'd get beginners to the language to start thinking more of what duck typing is, in Python.

--
DaveA
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to