p.singular_noun("pair_of_scissors") raises a TypeError
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 127
- PR merge metrics
- No merged PRs in 30d
Description
This seems to be a regression sometime between `v6.0.4` and `7.4.0` with a simple repro step.
Reproed on MacOS Python 3.11, 3.9, confirms v6.0.4 works as expected, as long as pydantic dependency is ", line 1, in
File "/Users/paulannetts/.pyenv/versions/3.9.18-test/lib/python3.9/site-packages/inflect/__init__.py", line 2597, in singular_noun
sing = self._sinoun(word, count=count, gender=gender)
File "/Users/paulannetts/.pyenv/versions/3.9.18-test/lib/python3.9/site-packages/inflect/__init__.py", line 3233, in _sinoun
return self._handle_long_compounds(words, count=1) or word
File "/Users/paulannetts/.pyenv/versions/3.9.18-test/lib/python3.9/site-packages/inflect/__init__.py", line 3037, in _handle_long_compounds
return next(solutions, None)
File "/Users/paulannetts/.pyenv/versions/3.9.18-test/lib/python3.9/site-packages/inflect/__init__.py", line 3027, in
" ".join(
TypeError: sequence item 0: expected str instance, bool found
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the reported `p.singular_noun("pair of scissors")` reproduction in `inflect/__init__.py`, then inspect `_sinoun` and `_handle_long_compounds` around the traceback lines 3027-3037. Verify the failure and confirm the fix returns `"pair of scissors"` without raising a TypeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100