Waylan Limberg wrote:

Not that we need another way but this would work as well, and it
doesn't need special cases for one and two item lists but does insert
the "and" (unlike most of the solutions offered):

def humanize_list(list):
    return ", and".join(map(str, ", ".join(map(str, list)).rsplit(',',1)))

>>> humanize_list(["one", "two"])
'one, and two'

</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