Skip to content

Add conjunction parameter to natural_list - #316

Open
SAY-5 wants to merge 1 commit into
python-humanize:mainfrom
SAY-5:feat-natural-list-conjunction
Open

SAY-5 wants to merge 1 commit into
python-humanize:mainfrom
SAY-5:feat-natural-list-conjunction

Conversation

@SAY-5

@SAY-5 SAY-5 commented May 18, 2026

Copy link
Copy Markdown

Fixes #214

Changes proposed in this pull request:

  • Add a keyword-only conjunction parameter to natural_list, defaulting to "and" so existing behaviour is unchanged.
  • This implements the design hugovk suggested in the issue, allowing any string such as "or" or "and also".
  • Add tests covering the new parameter alongside the default.

@codspeed

codspeed Bot commented May 19, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 15 untouched benchmarks


Comparing SAY-5:feat-natural-list-conjunction (6eb4231) with main (392aef7)

Open in CodSpeed

@codecov

codecov Bot commented May 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.69%. Comparing base (392aef7) to head (6eb4231).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #316   +/-   ##
=======================================
  Coverage   99.69%   99.69%           
=======================================
  Files          12       12           
  Lines         996      999    +3     
=======================================
+ Hits          993      996    +3     
  Misses          3        3           
Flag Coverage Δ
macos-latest 97.59% <100.00%> (+<0.01%) ⬆️
ubuntu-latest 97.59% <100.00%> (+<0.01%) ⬆️
windows-latest 93.29% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hugovk hugovk changed the title feat: add conjunction parameter to natural_list Add conjunction parameter to natural_list May 19, 2026
@hugovk hugovk added the changelog: Added For new features label May 19, 2026
@SAY-5

SAY-5 commented Aug 16, 2026

Copy link
Copy Markdown
Author

Any interest in this? It adds a conjunction argument to natural_list so callers can get "or" instead of the hardcoded "and".

@SAY-5
SAY-5 force-pushed the feat-natural-list-conjunction branch from 0cedecf to 6eb4231 Compare September 27, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: Added For new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal for additional conjunction parameter in natural_list function

2 participants