Jeremy Dunck wrote:

NOT_GIVEN="(*piuhuI&*uyobJH!ikuoi1p9e;mks c0p[p"

def reduce_(f,s,i=NOT_GIVEN):
   it=iter(s)
   if i == NOT_GIVEN:

hmm. if you post code like that often enough, we may have to revoke your python coder's license ;-)

:::

for the archives, here's the "right" way to do it:

   NOT_GIVEN = object() # sentinel

   def reduce_(f,s,i=NOT_GIVEN):
       it=iter(s)
       if i is NOT_GIVEN:
          ...

if you need to support really old Python versions, you can replace the object() call with something like:

   NOT_GIVEN = ["sentinel"]

:::

merry christmas, everyone! (or should that be "happy winterval?")

</F>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to