[Python-Dev] Let's just *keep* lambda

Crutcher Dunnavant crutcher at gmail.com
Sun Feb 5 23:26:54 CET 2006


Which reminds me, we need to support roman numeral constants.
A silly implementation follows.

class RomanNumeralDict(dict):
  def __getitem__(self, key):
    if not self.has_key(key) and self.isRN(key):
      return self.decodeRN(key)
    return dict.__getitem__(self, key)

  def isRN(self, key):
    for c in key:
      if c not in 'MmCcXxIiDdVv':
        return False
    return True

  def decodeRN(self, key):
    val = 0
    # ... do stuff ...
    return val

On 2/5/06, Tim Peters <tim.peters at gmail.com> wrote:
> [Guido]
> > After so many attempts to come up with an alternative for lambda,
> > perhaps we should admit defeat. I've not had the time to follow the
> > most recent rounds, but I propose that we keep lambda, so as to stop
> > wasting everybody's talent and time on an impossible quest.
>
> Huh!  Was someone bad-mouthing lambda again?  We should keep it, but
> rename it to honor a different Greek letter.  xi is a good one, easier
> to type, and would lay solid groundwork for future flamewars between
> xi enthusiasts and Roman numeral fans :-)
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/crutcher%40gmail.com
>


--
Crutcher Dunnavant <crutcher at gmail.com>
monket.samedi-studios.com


More information about the Python-Dev mailing list