Python type system experiments.

Push the envelope as far as you can!
...and then give up and use cast(), because we don't have applicative
functors or higher kinded types
This commit is contained in:
Sai Nane
2025-03-08 18:01:57 +00:00
committed by DomNomNomVR
parent c7fe539ac6
commit c5eaba88b7
5 changed files with 121 additions and 45 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ from typing import NamedTuple
from unittest.mock import MagicMock
from gears import Gear
from gears.connections import connect
from gears.effect import effect_of, effect_of_2
from gears.effect import effect_of
def test_get_set():
@@ -35,7 +35,7 @@ def test_effect_of_2():
last_arg: tuple[str, int] | None = None
@effect_of_2(g1, g2)
@effect_of(g1, g2)
def value_changed(v1: str, v2: int):
nonlocal last_arg
last_arg = (v1, v2)