Skip to content

Commit

Permalink
fix: import Self from typing_extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
CNSeniorious000 committed Dec 6, 2023
1 parent 69dd3b1 commit a32701f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion python/promplate/chain/node.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from collections import ChainMap
from typing import TYPE_CHECKING, Callable, Mapping, MutableMapping, Self, TypeVar, overload
from typing import TYPE_CHECKING, Callable, Mapping, MutableMapping, TypeVar, overload

from ..llm.base import *
from ..prompt.template import Context, Loader, Template
Expand Down Expand Up @@ -39,6 +39,13 @@ def result(self):
self.__delitem__("__result__")

if TYPE_CHECKING: # fix type from `collections.ChainMap`
from sys import version_info

if version_info >= (3, 11):
from typing_extensions import Self
else:
from typing import Self

copy: Callable[[Self], Self]


Expand Down

0 comments on commit a32701f

Please sign in to comment.