Skip to content

fix: correct generic return type in component utils #2796

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

Merged
merged 8 commits into from
Jun 4, 2025

Conversation

Lumabots
Copy link
Contributor

Summary

Items should use either [View] and it was not the case, leading to error :

Type of "__init__" is partially unknown
  Type of "__init__" is "(*items: Item[Unknown], timeout: float | None = 180, disable_on_timeout: bool = False) -> None"

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
  • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.

@Lumabots
Copy link
Contributor Author

so im 80% sure items should only be used like this in the view, however 80 might not be enough so if someone can confirm to make sure would be nice

@Dorukyum
Copy link
Member

I think a new typevar would make this more flexible.

V = TypeVar("V", bound="View", covariant=True)
Item[V]

@Lumabots
Copy link
Contributor Author

Lumabots commented May 31, 2025

I think a new typevar would make this more flexible.

V = TypeVar("V", bound="View", covariant=True)

Item[V]

The typevar does exist in the item, should I import it or make it again ?
i just made it

@Dorukyum Dorukyum self-requested a review June 2, 2025 04:33
@Dorukyum Dorukyum enabled auto-merge (squash) June 4, 2025 10:55
@Lulalaby Lulalaby disabled auto-merge June 4, 2025 19:20
@Lulalaby Lulalaby merged commit 0571244 into Pycord-Development:master Jun 4, 2025
28 checks passed
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