Skip to content

[yt-dlp] Rename private options type - #16354

Open
ryux1 wants to merge 3 commits into
python:mainfrom
ryux1:ryux1/yt-dlp-public-options
Open

[yt-dlp] Rename private options type#16354
ryux1 wants to merge 3 commits into
python:mainfrom
ryux1:ryux1/yt-dlp-public-options

Conversation

@ryux1

@ryux1 ryux1 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Rename the type-checking-only _Params TypedDict to _YoutubeDLOptions so its role is clear while preserving the private underscore required for a symbol that does not exist at runtime.

Prepared with OpenAI Codex.

@github-actions

This comment has been minimized.

@donbarbos

donbarbos commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for contributing!
Your tests also pass on the main branch. The only change here is renaming the TypedDict, but unfortunately, there doesn't seem to be any justification for it (unless I'm missing something). _Params can also be imported.

@ryux1

ryux1 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

The distinction I’m addressing is public typing API rather than runtime importability. _Params can technically be imported, but its leading underscore marks it private, so recommending it in user annotations couples callers to an implementation name and can trigger private-usage diagnostics under stricter checker configurations.

The linked issue’s stored-dictionary pattern needs an explicit TypedDict annotation to retain per-key contextual types; YoutubeDLOptions provides a supported name for that annotation while preserving strict option-value checking. The added test exercises exactly that pattern.

If Typeshed’s policy is to leave this type private despite #16331, I’m happy to close this, but the rename is the intended behavioral change: making the existing option schema a public type-checking API.

Comment thread stubs/yt-dlp/@tests/test_cases/check_options.py Outdated
@github-actions

This comment has been minimized.

Comment thread stubs/yt-dlp/yt_dlp/__init__.pyi Outdated
@ryux1 ryux1 changed the title [yt-dlp] Expose options type [yt-dlp] Rename private options type Sep 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

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.

4 participants