Skip to content

feat: add conjunction option to natural_list - #398

Draft
zihjiang wants to merge 1 commit into
python-humanize:mainfrom
zihjiang:feat/natural-list-conjunction-214
Draft

feat: add conjunction option to natural_list#398
zihjiang wants to merge 1 commit into
python-humanize:mainfrom
zihjiang:feat/natural-list-conjunction-214

Conversation

@zihjiang

Copy link
Copy Markdown

Summary

Add a configurable conjunction to natural_list().

Changes

  • Add a conjunction parameter defaulting to "and".
  • Support custom conjunctions such as "or" and "and also" for two-item and longer lists.
  • Preserve existing behavior for empty and single-item iterables.
  • Document the new parameter and usage example.

Tests

  • uv run pytest -q — 729 passed, 74 skipped
  • uvx ruff check src/humanize/lists.py tests/test_lists.py
  • uvx ruff format --check src/humanize/lists.py tests/test_lists.py
  • uvx prek run --files src/humanize/lists.py tests/test_lists.py
  • git diff --check

Fixes #214

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal for additional conjunction parameter in natural_list function

1 participant