[Tutor] How is "set(ls).add('a') evaluated? [Was: Re: A program that can check if all elements of the list are mutually disjoint]
Richard Damon
Richard at Damon-Family.org
Sun Jun 6 20:56:45 EDT 2021
On 6/6/21 8:01 PM, Marc Tompkins wrote:
> On Sun, Jun 6, 2021 at 4:11 PM Mats Wichmann <mats at wichmann.us> wrote:
>
>> On 6/6/21 5:05 PM, Cameron Simpson wrote:
>>
>>> "add" is a verb. It modifies the set. "union" is a noun: it returns a
>>> thing computed from the set(s).
>> ...
>>> Grammar helps, provided that people have put a little effort into naming
>>> the API calls.
>> Yeah, that: API design is actually not that easy. Including naming :)
>>
> This reminds me of a conversation I had, years ago, when I was puzzled over
> whether a particular (Los Angeles) street was a boulevard or an avenue. My
> associate was shocked - SHOCKED! - that I didn't know that avenues are
> always north/south and boulevards always east/west. So I pulled out the
> Thomas Guide and showed him multiple intersections in our
> neighborhood where two avenues, or two boulevards, crossed at right angles.
>
> It's all very well knowing the canonical rules, but if there are enough
> exceptions the rules become almost a hindrance to understanding.
It's quite possible that two avenues which are both 'north/south' cross
at 90 degrees as the north-south rule is likely a 'general' case, while
at a particular point they may deviate significantly.
I have one stretch of road near me that is at the same time a North
Bound Highway, an East Bound Highway and a South Bound Highway.
--
Richard Damon
More information about the Tutor
mailing list