Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict "params" to list or None #104

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

radarhere
Copy link

Suggestion for python-pillow#7407

In your PR at the moment,

def cmd_nmake(
    makefile: str | None = None,
    target: str = "",
    params: str | list[str] | tuple[str, ...] = None,
) -> str:
    if params is None:
        params = ""
    elif isinstance(params, (list, tuple)):
        params = " ".join(params)
    else:
        params = str(params)

params is either a string, list or tuple. When it is a string, str(params) is called? I find this odd, since it is already a string.

cmd_nmake is only called either without the third argument, or with a list, so maybe the simplest solution is just to restrict it to those two options?

@hugovk
Copy link
Owner

hugovk commented Sep 20, 2023

Yup, nice cleanup!

@hugovk hugovk merged commit 6e58b34 into hugovk:ci-appveyor-depends Sep 20, 2023
45 of 49 checks passed
@radarhere radarhere deleted the ci-appveyor-depends branch September 20, 2023 11:48
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.

2 participants