We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ae9579 commit 756bc76Copy full SHA for 756bc76
1 file changed
traitlets/traitlets.py
@@ -495,17 +495,15 @@ def instance_init(self, obj: t.Any) -> None:
495
G = TypeVar("G")
496
S = TypeVar("S")
497
T = TypeVar("T")
498
-
+K = TypeVar("K", default=str)
499
+V = TypeVar("V", default=t.Any)
500
501
# Self from typing extension doesn't work well with mypy https://github.com/python/mypy/pull/14041
502
# see https://peps.python.org/pep-0673/#use-in-generic-classes
503
# Self = t.TypeVar("Self", bound="TraitType[Any, Any]")
504
if t.TYPE_CHECKING:
505
from typing_extensions import Literal, Self
506
- K = TypeVar("K", default=str)
507
- V = TypeVar("V", default=t.Any)
508
509
510
# We use a type for the getter (G) and setter (G) because we allow
511
# for traits to cast (for instance CInt will use G=int, S=t.Any)
0 commit comments