-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OPT: add
__slots__
to more dataclasses ⚡️
- Loading branch information
Showing
4 changed files
with
19 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
from __future__ import annotations | ||
|
||
from abc import ABC, abstractmethod | ||
from dataclasses import dataclass | ||
from typing import Any, Generic | ||
|
||
from combadge._helpers.dataclasses import SLOTS | ||
from combadge.core.markers.base import AnnotatedMarker | ||
from combadge.core.typevars import BackendRequestT | ||
|
||
|
||
@dataclass(**SLOTS) | ||
class ParameterMarker(AnnotatedMarker, Generic[BackendRequestT], ABC): | ||
"""Parameter marker: it modifies a request with a call-time argument.""" | ||
|
||
__slots__ = () | ||
|
||
@abstractmethod | ||
def __call__(self, request: BackendRequestT, value: Any) -> None: | ||
"""Update the request according to the marker and the actual argument.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters