On Sun, Jan 19, 2020 at 3:10 PM Tim Peters <tim.pet...@gmail.com> wrote:

> [Guido, on Pythons before 1.0.2 always printing non-None expression
>  statement results]
> > Heh. That was such a misfeature that I had thoroughly suppressed any
> > memory of its existence. -k indeed. :-)
>
> I prefer to think of it as a bit of genius :-)
>
> The natural desire to avoid mounds of useless output taught all of us,
> core developers and end users, to code mutating methods as procedures
> (always return None) rather than functions.
>
> The thing that amazed me at the time (and still does with hindsight!)
> is how very few complaints that attracted!  Because it really was a
> horrible misfeature ;-)
>

My guess is that method chaining wasn't in widespread use, and languages
that made a distinction between functions and procedures (a la Pascal and
Fortran) were more common than they are now.

One thing that we lost when we dropped this: the bug where a user wrote
`foo` rather than `foo()` was caught more reliably then. Similarly, in the
async world, there's a common mistake where users write `foo()` rather than
`await foo()`, and that behavior would have caught such bugs.

Now we can't even flag such things statically (e.g. in mypy) because people
might complain that they *meant* to write what they wrote (since it works).

-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/BU73K4F4H3H4HOE5TZQF6MKADRRLPD23/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to