Skip to content

fix: Incorrect type annotations — use Optional[T] instead of T for nullable defaults #324

@kuishou68

Description

@kuishou68

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

  1. src/voxcpm/modules/minicpm4/config.py (line 29):

    • kv_channels: int = Nonekv_channels: Optional[int] = None
  2. src/voxcpm/modules/locdit/local_dit.py (line 30):

    • out_dim: int = Noneout_dim: Optional[int] = None
  3. src/voxcpm/core.py (lines 109, 183–185):

    • cache_dir: str = Nonecache_dir: Optional[str] = None
    • prompt_wav_path: str = Noneprompt_wav_path: Optional[str] = None
    • prompt_text: str = Noneprompt_text: Optional[str] = None
    • reference_wav_path: str = Nonereference_wav_path: Optional[str] = None

Expected behavior

All parameters that default to None should be annotated with Optional[T] for correct type checking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions