Raymond Hettinger added the comment:

> As far as I can tell currently there is no rule about this. 
> Intersection prefers the second operand, while union prefers the first.

The implementation uses the same logic as found in Lib/sets.py where the 
intersection operator loops over the SMALLER of the two input sets and does 
membership testing over the LARGER set.

> In any case, this information should be made explicit in the docs

Not really.  Historically, we've resisted the urge to over-specify or to 
declare something as undefined.  In general, we make affirmative guarantees 
when they are useful and when we're prepared to make sure the guarantee will 
always hold (for example, it took a long while before sorts were guaranteed to 
be stable).

Another consideration is that for most users, additional notes of "behavior xxx 
is undefined" is confusing, disconcerting, distracting, and rarely helpful.  
Language lawyers tend to request this sort of wording out of some sense of 
completeness, but it doesn't actually make the docs better for users.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20902>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to