[Python-Dev] Re: Sets: elt in dict, lst.include

Greg Ewing greg@cosc.canterbury.ac.nz
Wed, 24 Jan 2001 15:45:01 +1300 (NZDT)


Thomas Wouters <thomas@xs4all.net>:

> Now, if only there was a terribly obvious way to spell it... so that it's
> immediately obvious which of the two you wanted...

Well, in the case of

  for key in d:

or

  for value in d:

it's immediately obvious to a *human* reader what is meant,
so all we need to do is make the compiler a bit smarter. This
can easily be done by the use of a small table, containing
the equivalents of the words 'key' and 'value' in all known
natural languages, against which the target variable name is
matched using some suitable fuzzy matching algorithm.
Soundex could be used for this, if we can decide on which
version to use...

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+