In code, list.clear doesn't throw error - it's just ignored

Chris Angelico rosuav at gmail.com
Mon Nov 14 14:14:02 EST 2022


On Tue, 15 Nov 2022 at 05:57, Stefan Ram <ram at zedat.fu-berlin.de> wrote:
>
> Michael Speer <knomenet at gmail.com> writes:
> >Python doesn't care what an expression returns.
>
>   In my English, functions return values,
>   expression are being evaluated to a value.
>   The evaluation of a function yields or
>   produces a value. Expressions do not return,
>   because they are not functions.
>

Well, you can dispute the terminology all you like, but there's no
real difference between function calls and other types of expression.
They're all just expressions and they can be combined arbitrarily.

ChrisA


More information about the Python-list mailing list