[Tutor] How is "set(ls).add('a') evaluated? [Was: Re: A program that can check if all elements of the list are mutually disjoint]
boB Stepp
robertvstepp at gmail.com
Sat Jun 5 22:32:25 EDT 2021
I guess that I will conclude with a Python gripe from this eternal
learner and forgetter...
On Sat, Jun 5, 2021 at 9:19 PM boB Stepp <robertvstepp at gmail.com> wrote:
> > Why are these different in their results? # Referring to difference in return values for set add() and union() methods.
[snip]
> Caught up in something elementary once again. Sigh!
<Gripe>
I find it really hard to remember which functions and methods return
"None" and operate by side effect with those that return a new object.
This is especially difficult for me as I so often have long breaks
between using/studying Python. I wish that Python had some sort of
clever syntax that made it *obvious* which of the two possibilities
will occur.
</Gripe>
~(:>))
boB Stepp
More information about the Tutor
mailing list