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

[red-knot] Method calls and the descriptor protocol #16121

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sharkdp
Copy link
Contributor

@sharkdp sharkdp commented Feb 12, 2025

Summary

Work in progress… please do not review.

TODO

  • Write tests for method calls
    • Tests for all types of kinds that are instances
    • Tests for all unions
  • Write test for declared descriptor attributes
  • Implement assignment to descriptors
  • Find better names for newly introduced functions (try_call_dunder_get, non_descriptor_member, …)
  • Is BoundMethod the right term for this type?
  • Review the display implementation
  • Is it required to special-case __get__ in BoundMethod?
  • Review every call site of non_descriptor_member/member to see if we call the correct variant
  • Introduce KnownClass::MethodType

Test Plan

@sharkdp sharkdp added the red-knot Multi-file analysis & type inference label Feb 12, 2025
@sharkdp sharkdp force-pushed the david/descriptor-protocol branch from fe4235b to a463f6a Compare February 12, 2025 15:19
@sharkdp sharkdp force-pushed the david/descriptor-protocol branch from 4c9824a to 38d903d Compare February 12, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
red-knot Multi-file analysis & type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant