Repository: python/typing_extensions

Issue:
Third-party tests failed on Wed Jun 04 2025
Run listed here: https://github.com/python/typing_extensions/actions/runs/15432508980

Hints from issue comments:
@JelleZijlstra: Some issue in pydantic where it expects `__dict__` to exist on `TypedDict`: https://github.com/python/typing_extensions/actions/runs/15432508980/job/43432797173. I haven't fully figured out what's going on and why this didn't fail before, but ideally we should find some solution that doesn't break released versions of Pydantic.

cc @Viicos if you have insights. I'm out of time for today but may look more tomorrow.@AlexWaygood: It looks like https://github.com/python/typing_extensions/commit/d17c456d367e88adee4a4e3bef48f81f7e2df473 added `__slots__` to `_TypedDictSpecialForm` where there weren't any before — I'm guessing that was the cause?@Viicos: > I'm guessing that was the cause?

Seems like it works without the slots indeed.@AlexWaygood: I've kicked off a run of the third-party tests on `main` just to check that everything's now green after https://github.com/python/typing_extensions/pull/616: https://github.com/python/typing_extensions/actions/runs/15438196486@AlexWaygood: > I've kicked off a run of the third-party tests on `main` just to check that everything's now green after [#616](https://github.com/python/typing_extensions/pull/616): https://github.com/python/typing_extensions/actions/runs/15438196486

This is now complete — all third-party projects are green on our `main` branch now. Thanks @Viicos! 😃

Solution patch:
diff --git a/src/typing_extensions.py b/src/typing_extensions.py
index b97acf8..efa09d5 100644
--- a/src/typing_extensions.py
+++ b/src/typing_extensions.py
@@ -1272,8 +1272,6 @@ else:
         return td
 
     class _TypedDictSpecialForm(_SpecialForm, _root=True):
-        __slots__ = ('_name', '__doc__', '_getitem')
-
         def __call__(
             self,
             typename,


Test patch:
diff --git a/src/test_typing_extensions.py b/src/test_typing_extensions.py
index 6bc3de5..5de161f 100644
--- a/src/test_typing_extensions.py
+++ b/src/test_typing_extensions.py
@@ -5290,6 +5290,8 @@ class TypedDictTests(BaseTestCase):
              'z': 'Required[undefined]'},
         )
 
+    def test_dunder_dict(self):
+        self.assertIsInstance(TypedDict.__dict__, dict)
 
 class AnnotatedTests(BaseTestCase):