Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[yt-dlp] Make _Params["paths"] a Mapping[str, str]#14998

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Marcin795 wants to merge1 commit intopython:main
base:main
Choose a base branch
Loading
fromMarcin795:main

Conversation

@Marcin795
Copy link

paths accepts a dict of output paths (keys: 'home', 'temp', and OUTTMPL_TYPES keys). Typing it asMapping[str, str] | None matches runtime behavior and avoids false positives when passing a dict to YoutubeDL params.

paths key description in YoutubeDL.py:
Dictionary of output paths. The allowed keys are 'home', 'temp' and the keys of OUTTMPL_TYPES (in utils/_utils.py)
It's also asserted to be adict inget_output_path:
assert isinstance(paths, dict), '"paths" parameter must be a dictionary'

`paths` accepts a dict of output paths (keys: 'home', 'temp', and OUTTMPL_TYPES keys).Typing it as `Mapping[str, str] | None` matches runtime behavior and avoids false positiveswhen passing a dict to YoutubeDL params.
@github-actions
Copy link
Contributor

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

@srittau
Copy link
Collaborator

Considering that it must be adict, typing it asdict[str, str] sounds safer. In this case, there are no variance issues like we often have with dicts in argument positions. We could even consider using a literal as key or using aTypedDict.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@Marcin795@srittau

[8]ページ先頭

©2009-2025 Movatter.jp