fix: Incorrect type annotations — use Optional[T] instead of T for nullable defaults
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 37.8k
- Forks
- 4.3k
- Avg merge
- 7m
- Merged PRs (30d)
- 1
Description
Bug Report
Several parameters use bare type annotations with None as default value (e.g., int = None, str = None), which is incorrect. These should use Optional[T] = None to properly indicate nullable types per PEP 484.
Affected locations
-
src/voxcpm/modules/minicpm4/config.py (line 29):
kv_channels: int = None→kv_channels: Optional[int] = None
-
src/voxcpm/modules/locdit/local_dit.py (line 30):
out_dim: int = None→out_dim: Optional[int] = None
-
src/voxcpm/core.py (lines 109, 183–185):
cache_dir: str = None→cache_dir: Optional[str] = Noneprompt_wav_path: str = None→prompt_wav_path: Optional[str] = Noneprompt_text: str = None→prompt_text: Optional[str] = Nonereference_wav_path: str = None→reference_wav_path: Optional[str] = None
Expected behavior
All parameters that default to None should be annotated with Optional[T] for correct type checking.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the affected annotations in src/voxcpm/modules/minicpm4/config.py, src/voxcpm/modules/locdit/local_dit.py, and src/voxcpm/core.py. Update each parameter that defaults to None to use Optional[T], then verify that all listed nullable parameters are annotated consistently for type checking.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- audio-video-rtc
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100