Supply condition in function call

Rustom Mody rustompmody at gmail.com
Thu Mar 26 21:41:22 EDT 2015


On Thursday, March 26, 2015 at 11:30:57 AM UTC+5:30, Chris Angelico wrote:
> On Thu, Mar 26, 2015 at 3:02 PM, Rustom Mody  wrote:
> > [And BTW
> > help(filter) in python2 is much better documention than in python3
> > ]
> 
> Python 2.7.3 (default, Mar 13 2014, 11:03:55)
> [GCC 4.7.2] on linux2
> 
> filter(...)
>     filter(function or None, sequence) -> list, tuple, or string
> 
>     Return those items of sequence for which function(item) is true.  If
>     function is None, return the items that are true.  If sequence is a tuple
>     or string, return the same type, else return a list.
> 
> 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:
> (chomp a handful of method details)

Sackful may be more accurate :-)

On a different note... I wonder how you do it:
Look at 300 lines of code and notice exactly those 3 that... um... cause 
a lot of trouble :-)
[My eyes just glaze over]

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)

On a 3rd note: I think Ive found a little buglet while trying to post this message, can you confirm?
[Linux Debian Xfce]

After selecting the line above [inside python inside help(filter) ]for
cut-pasting here, by mistake I pressed Ctrl-C rather than Ctrl-Shift-C
An exception was thrown and the terminal remained in some sort of raw mode
even after exiting python



More information about the Python-list mailing list