Skip to content

Commit

Permalink
pyramid: re-use T1-T10
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Aug 11, 2023
1 parent 6d97226 commit 9c87894
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/svcs/pyramid.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from __future__ import annotations

from collections.abc import Callable
from typing import Any, Protocol, TypeVar, overload
from typing import Any, Protocol, overload

import attrs

Expand All @@ -17,7 +17,20 @@

import svcs

from ._core import _KEY_CONTAINER, _KEY_REGISTRY
from ._core import (
_KEY_CONTAINER,
_KEY_REGISTRY,
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
)


def svcs_from(request: Request | None = None) -> svcs.Container:
Expand Down Expand Up @@ -181,18 +194,6 @@ def get_abstract(*svc_types: type) -> Any:
return get(*svc_types)


T1 = TypeVar("T1")
T2 = TypeVar("T2")
T3 = TypeVar("T3")
T4 = TypeVar("T4")
T5 = TypeVar("T5")
T6 = TypeVar("T6")
T7 = TypeVar("T7")
T8 = TypeVar("T8")
T9 = TypeVar("T9")
T10 = TypeVar("T10")


@overload
def get(svc_type: type[T1], /) -> T1:
...
Expand Down

0 comments on commit 9c87894

Please sign in to comment.