From 80692706e4e136b9ef843d3af555c9913c32c5a8 Mon Sep 17 00:00:00 2001 From: Jason Manuel Date: Sat, 19 Oct 2024 19:14:15 -0700 Subject: [PATCH] Add docstrings for Environment and Substitutions --- concat/typecheck/env.py | 2 ++ concat/typecheck/substitutions.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/concat/typecheck/env.py b/concat/typecheck/env.py index 0382511..34dce07 100644 --- a/concat/typecheck/env.py +++ b/concat/typecheck/env.py @@ -18,6 +18,8 @@ class Environment(Mapping[str, 'Type']): + """A map from names in a typing context to the types of those names.""" + def __init__(self, env: Optional[Mapping[str, Type]] = None) -> None: self._env = env or {} self._sub_cache = dict[int, Environment]() diff --git a/concat/typecheck/substitutions.py b/concat/typecheck/substitutions.py index 0010602..3f5ae8f 100644 --- a/concat/typecheck/substitutions.py +++ b/concat/typecheck/substitutions.py @@ -33,6 +33,8 @@ def apply_substitution(self, sub: 'Substitutions') -> _Result: class Substitutions(Mapping['Variable', 'Type']): + """Substitutions of type variables with types.""" + __next_id = 0 def __init__(