Skip to content

Commit

Permalink
Changes:
Browse files Browse the repository at this point in the history
- fix typings
  • Loading branch information
devkral committed Dec 18, 2024
1 parent c9d2051 commit 01d76db
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions esmerald/pluggables/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from abc import ABC, abstractmethod
from inspect import isclass
from typing import TYPE_CHECKING, Any, Iterator, Optional, cast
Expand Down Expand Up @@ -57,12 +59,12 @@ def extend(self, config: PluggableConfig) -> None:
```
"""

def __init__(self, cls: type["ExtensionProtocol"] | str, **options: Any):
def __init__(self, cls: type[ExtensionProtocol] | str, **options: Any):
self.cls_or_string = cls
self.options = options

@property
def cls(self) -> type["ExtensionProtocol"]:
def cls(self) -> type[ExtensionProtocol]:
cls_or_string = self.cls_or_string
if isinstance(cls_or_string, str):
self.cls_or_string = cls_or_string = import_string(cls_or_string)
Expand Down Expand Up @@ -114,7 +116,7 @@ def extend(self, **kwargs: "DictAny") -> None:
def __init__(
self,
app: Annotated[
Optional["Esmerald"],
Optional[Esmerald],
Doc(
"""
An `Esmerald` application instance or subclasses of Esmerald.
Expand All @@ -138,7 +140,7 @@ def extend(self, **kwargs: Any) -> None:


class ExtensionDict(dict[str, Extension]):
def __init__(self, data: Any = None, *, app: "Esmerald"):
def __init__(self, data: Any = None, *, app: Esmerald):
super().__init__(data)
self.app = app
self.delayed_extend: Optional[dict[str, dict[str, Any]]] = {}
Expand Down

0 comments on commit 01d76db

Please sign in to comment.