From f365297baf3e18364c63adc697142ae12aa5f75c Mon Sep 17 00:00:00 2001 From: Anthony Ricaud Date: Sun, 21 Jul 2019 02:09:05 +0100 Subject: [PATCH] Allow any `Collection` to be passed to `has_perms` --- django-stubs/contrib/auth/models.pyi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/django-stubs/contrib/auth/models.pyi b/django-stubs/contrib/auth/models.pyi index a8a91d9..b7c0f09 100644 --- a/django-stubs/contrib/auth/models.pyi +++ b/django-stubs/contrib/auth/models.pyi @@ -1,4 +1,4 @@ -from typing import Any, List, Optional, Set, Tuple, Type, Union +from typing import Any, Collection, Optional, Set, Tuple, Type, Union from django.contrib.auth.base_user import AbstractBaseUser as AbstractBaseUser, BaseUserManager as BaseUserManager from django.contrib.contenttypes.models import ContentType @@ -42,7 +42,7 @@ class PermissionsMixin(models.Model): def get_group_permissions(self, obj: None = ...) -> Set[str]: ... def get_all_permissions(self, obj: Optional[str] = ...) -> Set[str]: ... def has_perm(self, perm: str, obj: Optional[str] = ...) -> bool: ... - def has_perms(self, perm_list: Union[List[str], Set[str], Tuple[str]], obj: None = ...) -> bool: ... + def has_perms(self, perm_list: Collection[str], obj: None = ...) -> bool: ... def has_module_perms(self, app_label: str) -> bool: ... class AbstractUser(AbstractBaseUser, PermissionsMixin): # type: ignore @@ -80,7 +80,7 @@ class AnonymousUser: def get_group_permissions(self, obj: None = ...) -> Set[Any]: ... def get_all_permissions(self, obj: Any = ...) -> Set[str]: ... def has_perm(self, perm: str, obj: None = ...) -> bool: ... - def has_perms(self, perm_list: Union[List[str], Tuple[str]], obj: None = ...) -> bool: ... + def has_perms(self, perm_list: Collection[str], obj: None = ...) -> bool: ... def has_module_perms(self, module: str) -> bool: ... @property def is_anonymous(self) -> bool: ...