On Jan 15, 2008 12:06 PM, Chris M <[EMAIL PROTECTED]> wrote:
> On Jan 15, 11:51 am, "Neil Cerutti" <[EMAIL PROTECTED]> wrote:
> >
> > So this is a bug in set_update or in set_ior. They can't both be
> > right.
> >
>
> It's not a bug.
>
> "Note, the non-operator versions of union(), intersection(),
> difference(), and symmetric_difference(), issubset(), and issuperset()
> methods will accept any iterable as an argument. In contrast, their
> operator based counterparts require their arguments to be sets. This
> precludes error-prone constructions like set('abc') & 'cbs' in favor
> of the more readable set('abc').intersection('cbs')."

Thanks. That neatly answers Skip's question, assuming he buys the
putative error pronicity. The docs say the design is based on lessons
learned from the sets module, so that also explains why it's different
from the module version, as well.

-- 
Neil Cerutti <[EMAIL PROTECTED]>
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to