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

functools.partialmethod simplification #124652

Open
dg-pb opened this issue Sep 27, 2024 · 1 comment
Open

functools.partialmethod simplification #124652

dg-pb opened this issue Sep 27, 2024 · 1 comment
Labels
type-feature A feature request or enhancement

Comments

@dg-pb
Copy link
Contributor

dg-pb commented Sep 27, 2024

Feature or enhancement

Proposal:

Now, as partial has __get__ and Placeholder it is probably a good idea to simplify partialmethod.

So the mental model of partialmethod can simply be:

partial, which always has the first argument set to Placeholder.

So partialmethod could maybe be a subclass partial, which would potentially simplify things.

Also, maybe there is a way so that partialmethod can be made obsolete altogether.

Will see where I can get to with this.
Any ideas welcome.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

#121027
#119827 (comment)

Linked PRs

@dg-pb dg-pb added the type-feature A feature request or enhancement label Sep 27, 2024
@rhettinger
Copy link
Contributor

Note that partialmethod also copies __isabstractmethod__ from the underlying callable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants