jaraco / jaraco/inflect

Cannot pass str value to `plural*()` function under type checking of Pylance (reportArgumentType)

Open
#233 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.1k
Forks
127
PR merge metrics
No merged PRs in 30d

Description

**My problem:**

Image

**The root of it:** `text: Word`

https://github.com/jaraco/inflect/blob/4b10e63076aa60d774e16ab96c8ab816748c93ef/inflect/__init__.py#L2412-L2431

This problem happens whenever I try to do type checking. Even it the lowest level "basic" it still not ignore it. See the spec below for my setup workspace:

- no `.env` file
- vscode version: `1.104.1`
- vscode extension
- ms-python.vscode-pylance `2025.8.2`
- ms-python.python `2025.14.0` (but disable 2 children: ms-python.vscode-python-envs, ms-python.debugpy)
- package manager: uv `0.8.22`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting inflect/__init__.py at lines 2412-2431, especially the text: Word annotation, and reproduce the reportArgumentType diagnostic with the Pylance setup described. Trace how plural*() accepts text values and determine the intended typing behavior; done means valid str arguments no longer produce the reported type-checking error without breaking pluralization.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.