Skip to content

Commit

Permalink
Use base class for type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed May 26, 2024
1 parent 4c6084f commit 0c5bcff
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/coaster/sqlalchemy/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ def roles_for(
from ..compat import g
from ..utils import InspectableSet, is_collection, is_dunder, nary_op
from .functions import idfilters
from .query import AppenderQuery

__all__ = [
'ActorType',
Expand Down Expand Up @@ -738,15 +737,15 @@ class DynamicAssociationProxyBind(abc.Mapping, Generic[_T, _V, _R]):
""":class:`DynamicAssociationProxy` bound to an instance."""

__slots__ = ('obj', 'rel', 'relattr', 'attr', 'qattr')
relattr: AppenderQuery
relattr: QueryBase
qattr: Optional[QueryableAttribute]

def __init__(
self, obj: _T, rel: str, attr: str, qattr: Optional[QueryableAttribute]
) -> None:
self.obj = obj
self.rel = rel
self.relattr: AppenderQuery[_R] = getattr(obj, rel)
self.relattr: QueryBase[_R] = getattr(obj, rel)
self.attr = attr
self.qattr = qattr

Expand Down

0 comments on commit 0c5bcff

Please sign in to comment.