Lies in education [was Re: The "loop and a half"]

ROGER GRAYDON CHRISTMAN dvl at psu.edu
Fri Oct 13 14:05:42 EDT 2017


On Sat, Oct 14, 2017, Gregory Ewing wrote:
>
Message: 5
>Date: Sat, 14 Oct 2017 01:54:49 +1300
>From: Gregory Ewing <greg.ewing at canterbury.ac.nz>
>To: python-list at python.org
>Subject: Re: Lies in education [was Re: The "loop and a half"]
>Message-ID: <f4brcrFnee4U1 at mid.individual.net>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>Neil Cerutti wrote:
>> I can tell at a glance if a parameter is expected to be
>> modifiable just by looking at the function signature.
>
>The question is why doesn't anyone feel the need to be
>able to do that for Python functions? Whether a function
>modifies things passed to it is just as important to
>know in Python as it is in C.
>


I'm just trying to put myself in the position of the programmer
who is in this position of identifying the modifiable parameters
in the function signature.    

Where are you getting the function signature?

Are you looking at the source code?   Or from the help() that access the module?

In both cases, the docstring is an easy solution.
The documentation itself in certainly state whether it modifies any parameter.
And it is directly visible along with the function signature either way.

We don't need any annotations or attributes or whatnot if we have
the perfectly normal function documentation.

Or is that kind of habit no longer practiced in 'the real world'?

Roger Christman
Pennsylvania State University





More information about the Python-list mailing list