From 7c4c1768e2c7f1135946a237bb29187f760a6237 Mon Sep 17 00:00:00 2001 From: Tomas Beran Date: Fri, 6 Feb 2026 13:40:01 -0800 Subject: [PATCH 1/3] fix: resolve ty no-matching-overload error on Sandbox.kill() Make class_method_variant inherit from Generic[T] so that ty can track the decorated function's type through the descriptor. Without this, ty fails overload resolution for all methods using the class_method_variant pattern (kill, connect, set_timeout, get_info, get_metrics, beta_pause). Fixes ty error[no-matching-overload] while remaining compatible with mypy and pyright. --- packages/python-sdk/e2b/sandbox/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/python-sdk/e2b/sandbox/utils.py b/packages/python-sdk/e2b/sandbox/utils.py index daf9d4a8b9..e147409e58 100644 --- a/packages/python-sdk/e2b/sandbox/utils.py +++ b/packages/python-sdk/e2b/sandbox/utils.py @@ -1,10 +1,10 @@ -from typing import TypeVar, Any, cast, Optional, Type +from typing import TypeVar, Any, Generic, cast, Optional, Type import functools T = TypeVar("T") -class class_method_variant(object): +class class_method_variant(Generic[T]): def __init__(self, class_method_name): self.class_method_name = class_method_name From 967dc474cae6e8668fcdd64cad13bac9a435f5a5 Mon Sep 17 00:00:00 2001 From: Tomas Beran Date: Fri, 6 Feb 2026 15:19:16 -0800 Subject: [PATCH 2/3] chore: add changeset for ty overload fix --- .changeset/fix-ty-overload-error.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fix-ty-overload-error.md diff --git a/.changeset/fix-ty-overload-error.md b/.changeset/fix-ty-overload-error.md new file mode 100644 index 0000000000..ec6eca382d --- /dev/null +++ b/.changeset/fix-ty-overload-error.md @@ -0,0 +1,5 @@ +--- +"e2b": patch +--- + +Fix ty type checker reporting no-matching-overload on Sandbox.kill() and other class_method_variant methods. From f66b494e595e1afcaca8d41c4606165c01070555 Mon Sep 17 00:00:00 2001 From: Tomas Beran Date: Fri, 6 Feb 2026 15:21:03 -0800 Subject: [PATCH 3/3] revert: remove changeset, will be added manually --- .changeset/fix-ty-overload-error.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .changeset/fix-ty-overload-error.md diff --git a/.changeset/fix-ty-overload-error.md b/.changeset/fix-ty-overload-error.md deleted file mode 100644 index ec6eca382d..0000000000 --- a/.changeset/fix-ty-overload-error.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"e2b": patch ---- - -Fix ty type checker reporting no-matching-overload on Sandbox.kill() and other class_method_variant methods.