Managing thirdparty package: defer.

This commit is contained in:
2026-05-13 05:09:23 -04:00
parent 8d6c91d306
commit 9266add6a1
10 changed files with 388 additions and 112 deletions
+13
View File
@@ -0,0 +1,13 @@
from types import FunctionType
class DeferErrror(RuntimeError):
pass
class FreeVarsError(DeferErrror):
def __init__(self, fn: FunctionType) -> None:
super().__init__(
"deferred function must not have free variables",
)
self.add_note("free vars: " + str(list(fn.__code__.co_freevars)))