[Python-3000] sets in P3K?

Edward Loper edloper at gradient.cis.upenn.edu
Thu Apr 27 02:41:59 CEST 2006


Guido van Rossum wrote:
> I don't think this form (set(1, 2, 3)) will ever fly, because it would
> makes set(x) ambiguous. 

For what it's worth, under the changes I was proposing set(x) would be 
unambiguous -- it would mean a set containing the single element x.  A 
separate class method would be required to create a set containing the 
elements of an iterable x.  I would be -1 on any proposal that tries to 
make set(x) depend on the value of x.

But I was only +0 on the proposal to begin with; and so if Guido's 
intuitions say that class method factories are "ugly and should be 
limited to cases that are rare but nevertheless useful," then it's 
fairly clear to me that this isn't the right way to go.  (Our BDFL's 
intuitions about what's ugly seem to be quite trustworthy.)

-Edward


More information about the Python-3000 mailing list