Skip to content

Allow subclasses of APIView to override get_permissions with return type implementing _SupportsHasPermission #320

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 2 commits into from
Jan 19, 2023

Conversation

guldfisk
Copy link
Contributor

Closes #319
Issue is that list is invariant, which makes the protocol not work.
Changing it so a sequence of course breaks stuff that relies on the result being mutable, but I am assuming that that should not be supported anyways.

Copy link
Contributor

@intgr intgr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this makes sense.

@intgr
Copy link
Contributor

intgr commented Jan 19, 2023

The SimpleRouter errors are unrelated to this branch, they should be fixed as a separate PR (similar to #311). I can look into it later if you don't get to it first.

intgr added a commit that referenced this pull request Jan 19, 2023
Suppressing new typecheck errors that were exposed in #320.

Now ignoring messages like 'note: "SimpleRouter" defined here' and "note: 'IntegerSerializer" defined here' globally because these aren't actually errors, just context.
@intgr
Copy link
Contributor

intgr commented Jan 19, 2023

I rebased this branch on top of CI fixes and tests pass now. Thanks!

@intgr intgr merged commit a9eee99 into typeddjango:master Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

When overriding APIView.get_permissions, mypy complains about return type incompatebility
2 participants