Supply condition in function call

Mark Lawrence breamoreboy at yahoo.co.uk
Fri Mar 27 12:00:00 EDT 2015


On 27/03/2015 13:48, Rustom Mody wrote:
> On Friday, March 27, 2015 at 10:05:21 AM UTC+5:30, Steven D'Aprano wrote:
>> On Fri, 27 Mar 2015 01:21 pm, Rustom Mody wrote:
>>
>>> Anyway my point is that in python (after 2.2??) saying something is an
>>> object is a bit of a tautology -- ie verbiage without information.
>>
>>
>> Er, it's *always* been a tautology. Every value in Python is an object,
>> including classes, and that has been always the case.
>>
>> However, just because it's a tautology doesn't mean it isn't useful to know.
>> (Tautologies are also known as *facts* and knowing facts is usually a good
>> thing.) For the majority of programming languages, it is not the case that
>> all values are objects, and not all people reading the documentation should
>> be expected to know that this applies to Python.
>
> I am making a point of pedagogy not semantics.
> This is help(filter) for python 2 and 3.
>
> Python2:
> Help on built-in function filter in module __builtin__:
>
> 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
> Help on class filter in module builtins:
>
> 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:
>   |
>   |  __getattribute__(self, name, /)
>   |      Return getattr(self, name).
>   |
>   |  __iter__(self, /)
>   |      Implement iter(self).
>   |
>   |  __new__(*args, **kwargs) from builtins.type
>   |      Create and return a new object.  See help(type) for accurate signature.
>   |
>   |  __next__(self, /)
>   |      Implement next(self).
>   |
>   |  __reduce__(...)
>   |      Return state information for pickling.
> ------------------------
>
> Try and put yourself in the place of a noob:
>
> Knows some C, not much else.
> Starts studying python.
> Good until a point.
> Then suddenly hit... map, filter, and the worst of all lambda.
> More he reads less he understands.
> Tries help... Gets the above.
>
> So which do you think helps him more python 2 or 3?
>

Can't say it bothers me personally as I never use Python 2 any more. 
What does bother me is the stream of complaints you make about the docs 
or docstrings but there are very few if any tracker issues to get these 
things sorted.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence




More information about the Python-list mailing list