[Python-3000] sets in P3K?
Guido van Rossum
guido at python.org
Wed May 3 19:02:28 CEST 2006
On 5/3/06, Greg Wilson <gvwilson at cs.utoronto.ca> wrote:
> I obviously haven't done the experiment yet, but I can pretty much
> guarantee you that newbies will trip over the inconsistency you're
> proposing:
>
> Type Two elements One element Empty
> List [1, 2] [1] []
> Dict {1:'a', 2:'b'} {1:'a'} {}
> Set {1, 2} {1} set()
>
> One of these things is not like the others... One of these things just
> doesn't belong...
Let's do a different experiment. Simply tell people that this is how
it is. See if anyone has trouble remembering the rule after getting it
wrong once or twice. That's how we learn irregularities in real life;
it works very well. (Orlijn is currently into past tenses so I am
constantly in awe how easy we can manage exceptions.)
> Or is "regular enough that newcomers' guesses about
> what to type are usually right" no longer a design consideration?
"Usually" being the operative word. Newcomers come from so many
different backgrounds and the language has so many subtle corners that
we can't possibly demand that every part of the language be obvious to
everyone right from the start.
Dicts are vastly more useful than sets. Something has to give. End of
discussion please.
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-3000
mailing list