Skip to content

docs: correct the documented input for engine.gender() in README#243

Open
SAY-5 wants to merge 1 commit into
jaraco:mainfrom
SAY-5:docs-fix-gender-readme
Open

docs: correct the documented input for engine.gender() in README#243
SAY-5 wants to merge 1 commit into
jaraco:mainfrom
SAY-5:docs-fix-gender-readme

Conversation

@SAY-5

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

Copy link
Copy Markdown

Addresses one of the issues in #116. The maintainer indicated in #116 (comment):

Thanks for the report, and I'm happy to accept a pull request to repair the issue(s).

The README currently documents gender() as taking the first letter of the gender:

Pass the first letter of the gender to ``gender`` to return the
f(eminine), m(asculine), n(euter) or t(hey) form of the singular. e.g.
gender('f') followed by singular_noun('themselves') returns 'herself'.

But engine.gender() actually validates its argument against singular_pronoun_genders (inflect/__init__.py line 1606), which only contains the full words "feminine", "masculine", "neuter", "gender-neutral", "feminine or masculine" and "masculine or feminine". Passing 'f' raises BadGenderError.

This PR rewrites that paragraph to list the accepted values and use gender("feminine") in the example, matching the existing working example at line 110 of the same README.

Verified locally:

>>> import inflect
>>> p = inflect.engine()
>>> p.gender('f')
inflect.BadGenderError
>>> p.gender('feminine')
>>> p.singular_noun('themselves')
'herself'

Unit tests pass (pytest tests/: 207 passed, 16 xfailed). No source code is changed; this is documentation only.

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
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.

1 participant