Amit Upadhyay wrote:
> 
> Actually I din't read the whole post, ignore my second sentence. We already
> have set_<whatever> for setting, and <whatever>_set would be confusing if we
> use it for just getting the "set" as someone pointed out, so <whatever>_list
> even if not totally accurate for the reasons you said.

The point is, we *won't* have set_<whatever> for setting anymore. The
only confusion seems to be if people can't tell the difference between a
verb and a noun. I'm afraid that we will end up with a very stilted api
if we have to use newspeak or lojban rather than english.

> PS: As of .append() sounding much wierder than .add(), I am not so sure, if
> we can with a little sacrifice in taste make it more like something a user
> may be already familier with it would help mure than hurt. So the only thing
> that makes it non list is lack of duplicates? dict.keys() return a list even
> tho they are non duplicates.

There were no sets in python when dictionaries were defined, and it
would not have been a good idea to break backwards compatibilty when
built in sets were introduced in python 2.4.

There *is* an implied ordering atm, so that keys() and values() are in
the same order.  So if you were designing python now, you might make
those into an ordered set.

Also, the lists returned here act like temporary lists returned as the
result of a function, ie they are throwaway. If you do
mydict.keys().append('something'), you acheive nothing. With the sets we
are talking about, reporter.article_set.add(name="Whatever"), you are
actually adding something to that set. And append really really will
look meaningless when the thing you have just appended is not at the end
of the "list". Very confusing IMO.

I'm still interested in a better default name, but I think
<whatever>_list is at least equally confusing as <whatever>_set. With
get_<whatever>_list() it did make sense because you were getting back a
newly minted list from that function. <whatever>_collection is imo
better from a clarity standpoint, but way too long.

Also, this is just a technical discussion, nothing personal ;-)

Reply via email to