Skip to content

Omit spaces when using keyword arguments#27

Open
PatrickHaecker wants to merge 1 commit into
jw3126:masterfrom
PatrickHaecker:compact_keyword_arguments
Open

Omit spaces when using keyword arguments#27
PatrickHaecker wants to merge 1 commit into
jw3126:masterfrom
PatrickHaecker:compact_keyword_arguments

Conversation

@PatrickHaecker

Copy link
Copy Markdown

This shortens calls a bit more and lets keyword arguments win more often against positional arguments.

This shortens calls a bit more and lets keyword arguments win more often against positional arguments.

Co-authored-by: Copilot <copilot@github.com>
@jw3126

jw3126 commented May 18, 2026

Copy link
Copy Markdown
Owner

What do you think about always using keywords except for single argument case maybe? #12 (comment)

@PatrickHaecker

PatrickHaecker commented May 19, 2026

Copy link
Copy Markdown
Author

What do you think about always using keywords except for single argument case maybe? #12 (comment)

I think this is an interesting proposal for the 3-arg show. I kindly suggest to include this proposal into the general discussion to not split it between different issues/PRs.

For the 2-arg show it seems to be the right thing to remove the spaces around the = as this mostly only needs to be machine-readable.

@aplavin

aplavin commented May 19, 2026

Copy link
Copy Markdown

I personally would strongly prefer Size(weight = 1, height = 2) than Size(1, 2) when both constructors exist, no matter 2/3-arg show. Maybe showrepr should be renamed to shortestrepr making the semantics more clear – ie that it's really about the shortest, not the most readable?

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.

3 participants