Skip to content

concatenate - serial comma incorrectly used with two items #63

Description

@jsamarziya

Per Wikipedia, a serial comma is

a comma placed immediately after the penultimate term... in a series of three or more terms

We would therefore expect that a serial comma would not be placed by concatenate() when given a sequence of two items, but this is not the case.

Expected:

>>> humanfriendly.text.concatenate(items=["foo", "bar"], serial_comma=True)
'foo and bar'

Actual:

>>> humanfriendly.text.concatenate(items=["foo", "bar"], serial_comma=True)
'foo, and bar'

Workaround:

>>> items = ["foo", "bar"]
>>> humanfriendly.text.concatenate(items=items, serial_comma=len(items) > 2)
'foo and bar'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions