David Mertz wrote:
> Set union, however, has a great deal in common with bitwise-or

On the contrary, in mathematics there's the concept of direct sum of sets, and 
the categorical sum, aka disjoint union. They are not union operations, but 
similar. They have not named them "direct or" and "categorical or" :D 

It's more logical for a mathematician to think to the union as a sort of 
particular sum, instead of an "or".

Furthermore, bitwise-or is an operation that is born for sequences. Indeed, 
bytes are sequences of bits, in a precise position. Sets are not sequences, so 
bitwise-or for sets is completely illogical.

> If we had a multi-set type (collections.Counter is close, but not exact)

It's not "not exact", it's completely unrelated. Counter is a subset of `dict` 
and has a beautiful update method. And if God wants, also a + instead of a 
pipe...

Chris Angelico wrote:
> > Subtracting two lists or two strings has no sense, so the comparison is
> > unfair.
> Except that it DOES make sense in some contexts. 

Source, please.

> People are far too
> quick to say that something "makes no sense", implying that there is
> no sensible way to interpret it. 

"There's preferably only one obvious way to do it", no?

> I've seen plenty of people complain
> that you can't add two strings together (ie that concatenation is
> fundamentally different from addition), that you can't multiply a list
> by an integer, that you can't multiply a string by an integer, that
> you can't divide a string by a string, etc, etc, etc. 

Well, they are wrong :D
They want funny and lazy operators? Suggest them numpy. numpy transform Python 
in the "language" Matlab. And I've seen numpy coders that used ~ also for 
simple integers... Really funny results. Usually they are scientists, and 
programming is boring for them.

> that's
> actually only one logically defensible interpretation of division
> (another being "split on this substring", and I'm sure there are
> others)

No. There is the split function. It's more typical that you forgot to transform 
the strings, that you probably get from a file, to numbers.

> I do ask people to be a little more respectful to the notion that these
> operations are meaningful.

.....respectful? I presented my opinion. You are free to agree or not. I've not 
swore of split on the floor :D

> Mathematically, the subset relationship is a perfectly reasonable
> ordering, so it makes perfect sense that the "<" operator be used for
> this meaning.

Mathematically, the operator is ⊂. "<" operator is used for comparison, and 
it's vital for sorting. And sorting sets makes no sense.

You have not ⊂ on your keyboard? Well.... sorry, you have to use a function :D

I'm not against operator overloading, on the contrary. But "<" was clearly 
chosen only because is graphically similar to ⊂, without thinking about the 
consequences.

> My guess is that you don't have a real name set, so your client has
> autogenerated a "real name" from the part of your email address before
> the at sign (the "mailbox" portion). If you set an actual name, it'll
> come through more readably to everyone else.

More simply, I'm posting from mail.python.org site, and I had not set name and  
surname in profile.
_______________________________________________
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/RY6E53BRU4XDQJUID56HTDXEXN2JSSDT/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to