File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3+ import collections .abc as c
34import hashlib
45import typing as t
56from collections .abc import MutableMapping
2021 from .wrappers import Response
2122
2223
23- # TODO generic when Python > 3.8
24- class SessionMixin (MutableMapping ): # type: ignore[type-arg]
24+ class SessionMixin (MutableMapping [str , t .Any ]):
2525 """Expands a basic dictionary with session attributes."""
2626
2727 @property
@@ -49,8 +49,7 @@ def permanent(self, value: bool) -> None:
4949 accessed = True
5050
5151
52- # TODO generic when Python > 3.8
53- class SecureCookieSession (CallbackDict , SessionMixin ): # type: ignore[type-arg]
52+ class SecureCookieSession (CallbackDict [str , t .Any ], SessionMixin ):
5453 """Base class for sessions based on signed cookies.
5554
5655 This session backend will set the :attr:`modified` and
@@ -72,7 +71,10 @@ class SecureCookieSession(CallbackDict, SessionMixin): # type: ignore[type-arg]
7271 #: different users.
7372 accessed = False
7473
75- def __init__ (self , initial : t .Any = None ) -> None :
74+ def __init__ (
75+ self ,
76+ initial : c .Mapping [str , t .Any ] | c .Iterable [tuple [str , t .Any ]] | None = None ,
77+ ) -> None :
7678 def on_update (self : te .Self ) -> None :
7779 self .modified = True
7880 self .accessed = True
You can’t perform that action at this time.
0 commit comments