Skip to content

Update typeshed and agents#11310

Merged
bschnurr merged 4 commits intomicrosoft:mainfrom
bschnurr:update-agents
Mar 18, 2026
Merged

Update typeshed and agents#11310
bschnurr merged 4 commits intomicrosoft:mainfrom
bschnurr:update-agents

Conversation

@bschnurr
Copy link
Copy Markdown
Member

@bschnurr bschnurr commented Mar 5, 2026

Summary

Handle typeshed "Make self and cls positional-only in dict constructor methods" python/typeshed#15262

Improve the agent guidance for typeshed update workflows so future update PRs are more consistent, reproducible, and easier to review.

What Changed

Updated agent/runbook documentation:

  • typeshed-update-agent.md

    • Added concrete instructions for running updateTypeshed.py
    • Added upstream investigation guidance (typeshed repo + compare links + PR references)
    • Added high-risk change pattern checklist
    • Added targeted test matrix for fast triage
    • Added precision regression guardrails
    • Added PR output template
    • Added escalation checklist
  • pyright-test-policy.md

    • Included in the commit as part of agent guidance updates
  • copilot-instructions.md

    • Included in the commit as part of agent guidance updates

Why

Recent typeshed updates surfaced subtle regressions (for example positional-only separator handling in constructors). These documentation changes codify a repeatable process to:

  • catch regressions earlier with focused tests
  • preserve type precision (T -> Unknown guardrails)
  • keep implementation fixes ahead of test-only updates
  • produce clearer, review-ready PRs

Validation

  • Documentation-only changes (no runtime/type-evaluator logic changed).
  • Existing test baseline remained green prior to this doc PR:
    • npm test in pyright-internal passed.

Notes for Reviewers

This PR intentionally changes guidance only. It does not modify analyzer behavior or sample expectations.

bschnurr and others added 4 commits March 4, 2026 15:38
Updated typeshed-fallback from commit a564787 to b0401bc7.

Key changes include:
- contextmanager/asynccontextmanager now have overloads preferring
  Generator/AsyncGenerator over Iterator/AsyncIterator (deprecated)
- dict.__init__ and dict.__new__ overloads add explicit positional-only
  markers on self/cls parameters
- slice type annotations now use parameterized slice types
- set/frozenset method signatures updated (Any -> object)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The new typeshed stubs add explicit positional-only markers to
dict.__new__: 'def __new__(cls, /, *args, **kwargs) -> Self'.

After binding strips 'cls', the positional-only separator '/' remains
in the parameter list, causing isDefaultNewMethod to fail its
parameter count check. This caused __new__ to no longer be recognized
as the default placeholder, breaking constructor overload resolution
for dict, defaultdict, and subclasses.

The fix skips a leading positional-only separator before checking
for the (*args, **kwargs) -> Self pattern.

Classification: B (Pyright bug revealed by new stubs)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The contextmanager decorator now has overloads that prefer
Generator over Iterator. Using Iterator triggers a deprecation
diagnostic in strict mode.

Classification: A (legitimate typeshed behavior change)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 5, 2026

Diff from mypy_primer, showing the effect of this PR on open source code:

scrapy (https://github.com/scrapy/scrapy)
-   .../projects/scrapy/tests/test_crawler.py:954:45 - error: Argument of type "dict[str, str]" cannot be assigned to parameter "env" of type "_Environ[str] | None" in function "__init__"
-     Type "dict[str, str]" is not assignable to type "_Environ[str] | None"
-       "dict[str, str]" is not assignable to "_Environ[str]"
-       "dict[str, str]" is not assignable to "None" (reportArgumentType)
-   .../projects/scrapy/tests/test_crawler.py:966:45 - error: Argument of type "dict[str, str]" cannot be assigned to parameter "env" of type "_Environ[str] | None" in function "__init__"
-     Type "dict[str, str]" is not assignable to type "_Environ[str] | None"
-       "dict[str, str]" is not assignable to "_Environ[str]"
-       "dict[str, str]" is not assignable to "None" (reportArgumentType)
- 1958 errors, 117 warnings, 0 informations
+ 1956 errors, 117 warnings, 0 informations

pyppeteer (https://github.com/pyppeteer/pyppeteer)
-   .../projects/pyppeteer/pyppeteer/navigator_watcher.py:49:58 - error: No overloads for "wait" match the provided arguments (reportCallIssue)
-   .../projects/pyppeteer/pyppeteer/navigator_watcher.py:49:71 - error: Argument of type "list[Future[Any] | Awaitable[None]]" cannot be assigned to parameter "fs" of type "Iterable[Task[_T@wait]]" in function "wait"
+   .../projects/pyppeteer/pyppeteer/navigator_watcher.py:51:13 - error: Argument of type "list[Future[Any] | Awaitable[None]]" cannot be assigned to parameter "fs" of type "Iterable[_FT@wait]" in function "wait"
-     "Future[Any]" is not assignable to "Task[_T@wait]"
+     Type "Awaitable[None]" is not assignable to type "Future[Any]"
-     "Awaitable[None]" is not assignable to "Task[_T@wait]" (reportArgumentType)
+       "Awaitable[None]" is not assignable to "Future[Any]" (reportArgumentType)
- 79 errors, 0 warnings, 0 informations
+ 78 errors, 0 warnings, 0 informations

ibis (https://github.com/ibis-project/ibis)
-   .../projects/ibis/ibis/common/collections.py:61:28 - error: Cannot access attribute "register" for class "type[Container[_T_co@Container]]"
+   .../projects/ibis/ibis/common/collections.py:61:28 - error: Cannot access attribute "register" for class "type[Container[_ContainerT_contra@Container]]"

antidote (https://github.com/Finistere/antidote)
+   .../projects/antidote/src/antidote/core/_catalog.py:383:6 - error: The function "contextmanager" is deprecated
+     Annotating the return type as `-> Iterator[Foo]` with `@contextmanager` is deprecated. Use `-> Generator[Foo]` instead. (reportDeprecated)
+   .../projects/antidote/tests/internal/test_utils.py:14:2 - error: The function "contextmanager" is deprecated
+     Annotating the return type as `-> Iterator[Foo]` with `@contextmanager` is deprecated. Use `-> Generator[Foo]` instead. (reportDeprecated)
- 267 errors, 80 warnings, 0 informations
+ 269 errors, 80 warnings, 0 informations

sympy (https://github.com/sympy/sympy)
-   .../projects/sympy/sympy/combinatorics/coset_table.py:824:21 - error: Argument of type "None" cannot be assigned to parameter "s" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/sympy/sympy/combinatorics/coset_table.py:824:21 - error: Argument of type "None" cannot be assigned to parameter "s" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "None" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "None" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/sympy/sympy/combinatorics/homomorphisms.py:57:25 - error: Argument of type "Basic | Unknown" cannot be assigned to parameter "s" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/sympy/sympy/combinatorics/homomorphisms.py:57:25 - error: Argument of type "Basic | Unknown" cannot be assigned to parameter "s" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     Type "Basic | Unknown" is not assignable to type "slice[Any, Any, Any]"
-       "Basic" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     Type "Basic | Unknown" is not assignable to type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]"
+       "Basic" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/sympy/sympy/combinatorics/permutations.py:2303:34 - error: Argument of type "None" cannot be assigned to parameter "s" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/sympy/sympy/combinatorics/permutations.py:2303:34 - error: Argument of type "None" cannot be assigned to parameter "s" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "None" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "None" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/sympy/sympy/combinatorics/tensor_can.py:464:24 - error: Argument of type "Unknown | tuple[Unknown, ...] | int" cannot be assigned to parameter "s" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/sympy/sympy/combinatorics/tensor_can.py:464:24 - error: Argument of type "Unknown | tuple[Unknown, ...] | int" cannot be assigned to parameter "s" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     Type "Unknown | tuple[Unknown, ...] | int" is not assignable to type "slice[Any, Any, Any]"
-       "int" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     Type "Unknown | tuple[Unknown, ...] | int" is not assignable to type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]"
+       "int" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/sympy/sympy/core/containers.py:352:9 - error: Method "add" overrides class "MutableSet" in an incompatible manner
-     Parameter 2 name mismatch: base parameter is named "value", override parameter is named "key" (reportIncompatibleMethodOverride)
-   .../projects/sympy/sympy/core/containers.py:355:9 - error: Method "discard" overrides class "MutableSet" in an incompatible manner
-     Parameter 2 name mismatch: base parameter is named "value", override parameter is named "key" (reportIncompatibleMethodOverride)
-   .../projects/sympy/sympy/core/multidimensional.py:126:25 - error: Argument of type "int | str | Unknown" cannot be assigned to parameter "key" of type "slice[Any, Any, Any]" in function "__setitem__"
+   .../projects/sympy/sympy/core/multidimensional.py:126:25 - error: Argument of type "int | str | Unknown" cannot be assigned to parameter "key" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__setitem__"
-     Type "int | str | Unknown" is not assignable to type "slice[Any, Any, Any]"
-       "int" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     Type "int | str | Unknown" is not assignable to type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]"
+       "int" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/sympy/sympy/core/power.py:931:18 - error: Argument of type "None" cannot be assigned to parameter "key" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/sympy/sympy/core/power.py:931:18 - error: Argument of type "None" cannot be assigned to parameter "key" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "None" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "None" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/sympy/sympy/core/power.py:933:16 - error: Argument of type "ImaginaryUnit" cannot be assigned to parameter "key" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/sympy/sympy/core/power.py:933:16 - error: Argument of type "ImaginaryUnit" cannot be assigned to parameter "key" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "ImaginaryUnit" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "ImaginaryUnit" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/sympy/sympy/core/relational.py:1579:16 - error: Argument of type "None" cannot be assigned to parameter "key" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/sympy/sympy/core/relational.py:1579:16 - error: Argument of type "None" cannot be assigned to parameter "key" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "None" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "None" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/sympy/sympy/core/relational.py:1581:20 - error: Argument of type "None" cannot be assigned to parameter "key" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/sympy/sympy/core/relational.py:1581:20 - error: Argument of type "None" cannot be assigned to parameter "key" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "None" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "None" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/sympy/sympy/core/relational.py:1582:38 - error: Argument of type "Literal['real']" cannot be assigned to parameter "key" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/sympy/sympy/core/relational.py:1582:38 - error: Argument of type "Literal['real']" cannot be assigned to parameter "key" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "Literal['real']" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "Literal['real']" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/sympy/sympy/core/relational.py:1582:60 - error: Argument of type "Literal['real']" cannot be assigned to parameter "key" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/sympy/sympy/core/relational.py:1582:60 - error: Argument of type "Literal['real']" cannot be assigned to parameter "key" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "Literal['real']" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "Literal['real']" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/sympy/sympy/core/relational.py:1583:42 - error: Argument of type "Literal['imag']" cannot be assigned to parameter "key" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/sympy/sympy/core/relational.py:1583:42 - error: Argument of type "Literal['imag']" cannot be assigned to parameter "key" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "Literal['imag']" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "Literal['imag']" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/sympy/sympy/core/relational.py:1583:68 - error: Argument of type "Literal['imag']" cannot be assigned to parameter "key" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/sympy/sympy/core/relational.py:1583:68 - error: Argument of type "Literal['imag']" cannot be assigned to parameter "key" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "Literal['imag']" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "Literal['imag']" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/sympy/sympy/geometry/line.py:1213:60 - error: Operator "-" not supported for types "set[str]" and "set[Unknown | Basic | Symbol]" (reportOperatorIssue)

... (truncated 945 lines) ...

more-itertools (https://github.com/more-itertools/more-itertools)
-     Positional parameter count mismatch; base method has 4, but override has 2
+     Positional parameter count mismatch; base method has 4, but override has 2 (reportIncompatibleMethodOverride)
-     Parameter 3 mismatch: base parameter "start" is keyword parameter, override parameter is position-only
-     Parameter 4 mismatch: base parameter "stop" is keyword parameter, override parameter is position-only (reportIncompatibleMethodOverride)

kornia (https://github.com/kornia/kornia)
-   .../projects/kornia/kornia/feature/dedode/transformer/dinov2.py:320:30 - error: Argument of type "Literal['x_norm_clstoken']" cannot be assigned to parameter "s" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/kornia/kornia/feature/dedode/transformer/dinov2.py:320:30 - error: Argument of type "Literal['x_norm_clstoken']" cannot be assigned to parameter "s" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "Literal['x_norm_clstoken']" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "Literal['x_norm_clstoken']" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/kornia/kornia/filters/gaussian.py:108:46 - error: Argument of type "tuple[slice[None, None, None], Literal[1]]" cannot be assigned to parameter "key" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/kornia/kornia/filters/gaussian.py:108:46 - error: Argument of type "tuple[slice[None, None, None], Literal[1]]" cannot be assigned to parameter "key" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "tuple[slice[None, None, None], Literal[1]]" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "tuple[slice[None, None, None], Literal[1]]" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/kornia/kornia/filters/gaussian.py:109:46 - error: Argument of type "tuple[slice[None, None, None], Literal[0]]" cannot be assigned to parameter "key" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/kornia/kornia/filters/gaussian.py:109:46 - error: Argument of type "tuple[slice[None, None, None], Literal[0]]" cannot be assigned to parameter "key" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "tuple[slice[None, None, None], Literal[0]]" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "tuple[slice[None, None, None], Literal[0]]" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/kornia/kornia/filters/kernels.py:710:24 - error: Argument of type "tuple[slice[None, None, None], Literal[0], None]" cannot be assigned to parameter "key" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/kornia/kornia/filters/kernels.py:710:24 - error: Argument of type "tuple[slice[None, None, None], Literal[0], None]" cannot be assigned to parameter "key" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "tuple[slice[None, None, None], Literal[0], None]" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "tuple[slice[None, None, None], Literal[0], None]" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/kornia/kornia/filters/kernels.py:710:43 - error: Argument of type "tuple[slice[None, None, None], Literal[1], None]" cannot be assigned to parameter "key" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/kornia/kornia/filters/kernels.py:710:43 - error: Argument of type "tuple[slice[None, None, None], Literal[1], None]" cannot be assigned to parameter "key" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "tuple[slice[None, None, None], Literal[1], None]" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "tuple[slice[None, None, None], Literal[1], None]" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/kornia/kornia/filters/kernels.py:769:33 - error: Argument of type "tuple[slice[None, None, None], Literal[0], None]" cannot be assigned to parameter "key" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/kornia/kornia/filters/kernels.py:769:33 - error: Argument of type "tuple[slice[None, None, None], Literal[0], None]" cannot be assigned to parameter "key" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "tuple[slice[None, None, None], Literal[0], None]" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "tuple[slice[None, None, None], Literal[0], None]" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/kornia/kornia/filters/kernels.py:769:52 - error: Argument of type "tuple[slice[None, None, None], Literal[1], None]" cannot be assigned to parameter "key" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/kornia/kornia/filters/kernels.py:769:52 - error: Argument of type "tuple[slice[None, None, None], Literal[1], None]" cannot be assigned to parameter "key" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "tuple[slice[None, None, None], Literal[1], None]" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "tuple[slice[None, None, None], Literal[1], None]" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/kornia/kornia/filters/kernels.py:769:71 - error: Argument of type "tuple[slice[None, None, None], Literal[2], None]" cannot be assigned to parameter "key" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/kornia/kornia/filters/kernels.py:769:71 - error: Argument of type "tuple[slice[None, None, None], Literal[2], None]" cannot be assigned to parameter "key" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "tuple[slice[None, None, None], Literal[2], None]" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "tuple[slice[None, None, None], Literal[2], None]" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/kornia/kornia/filters/kernels_geometry.py:175:17 - error: Argument of type "None" cannot be assigned to parameter "key" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/kornia/kornia/filters/kernels_geometry.py:175:17 - error: Argument of type "None" cannot be assigned to parameter "key" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "None" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "None" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/kornia/kornia/filters/kernels_geometry.py:208:31 - error: Argument of type "tuple[slice[None, None, None], Literal[0]]" cannot be assigned to parameter "key" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/kornia/kornia/filters/kernels_geometry.py:208:31 - error: Argument of type "tuple[slice[None, None, None], Literal[0]]" cannot be assigned to parameter "key" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "tuple[slice[None, None, None], Literal[0]]" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "tuple[slice[None, None, None], Literal[0]]" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/kornia/kornia/filters/kernels_geometry.py:208:44 - error: Argument of type "tuple[slice[None, None, None], Literal[1]]" cannot be assigned to parameter "key" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/kornia/kornia/filters/kernels_geometry.py:208:44 - error: Argument of type "tuple[slice[None, None, None], Literal[1]]" cannot be assigned to parameter "key" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "tuple[slice[None, None, None], Literal[1]]" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "tuple[slice[None, None, None], Literal[1]]" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/kornia/kornia/filters/kernels_geometry.py:208:57 - error: Argument of type "tuple[slice[None, None, None], Literal[2]]" cannot be assigned to parameter "key" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/kornia/kornia/filters/kernels_geometry.py:208:57 - error: Argument of type "tuple[slice[None, None, None], Literal[2]]" cannot be assigned to parameter "key" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "tuple[slice[None, None, None], Literal[2]]" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "tuple[slice[None, None, None], Literal[2]]" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/kornia/kornia/geometry/boxes.py:322:9 - error: Argument of type "tuple[EllipsisType, Literal[0]]" cannot be assigned to parameter "s" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/kornia/kornia/geometry/boxes.py:322:9 - error: Argument of type "tuple[EllipsisType, Literal[0]]" cannot be assigned to parameter "s" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "tuple[EllipsisType, Literal[0]]" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)

... (truncated 173 lines) ...

paasta (https://github.com/yelp/paasta)
-   .../projects/paasta/paasta_tools/contrib/bounce_log_latency_parser.py:48:54 - error: Argument of type "float" cannot be assigned to parameter "s" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/paasta/paasta_tools/contrib/bounce_log_latency_parser.py:48:54 - error: Argument of type "float" cannot be assigned to parameter "s" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "float" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "float" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/paasta/paasta_tools/contrib/bounce_log_latency_parser.py:49:43 - error: Argument of type "float" cannot be assigned to parameter "s" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/paasta/paasta_tools/contrib/bounce_log_latency_parser.py:49:43 - error: Argument of type "float" cannot be assigned to parameter "s" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "float" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "float" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/paasta/paasta_tools/contrib/bounce_log_latency_parser.py:50:43 - error: Argument of type "float" cannot be assigned to parameter "s" of type "slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/paasta/paasta_tools/contrib/bounce_log_latency_parser.py:50:43 - error: Argument of type "float" cannot be assigned to parameter "s" of type "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     "float" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+     "float" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/paasta/paasta_tools/contrib/check_orphans.py:165:24 - error: Argument of type "Literal['instance_id']" cannot be assigned to parameter "key" of type "SupportsIndex | slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/paasta/paasta_tools/contrib/check_orphans.py:165:24 - error: Argument of type "Literal['instance_id']" cannot be assigned to parameter "key" of type "SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     Type "Literal['instance_id']" is not assignable to type "SupportsIndex | slice[Any, Any, Any]"
+     Type "Literal['instance_id']" is not assignable to type "SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]"
-       "Literal['instance_id']" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+       "Literal['instance_id']" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/paasta/paasta_tools/contrib/check_orphans.py:170:24 - error: Argument of type "Literal['services']" cannot be assigned to parameter "key" of type "SupportsIndex | slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/paasta/paasta_tools/contrib/check_orphans.py:170:24 - error: Argument of type "Literal['services']" cannot be assigned to parameter "key" of type "SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     Type "Literal['services']" is not assignable to type "SupportsIndex | slice[Any, Any, Any]"
+     Type "Literal['services']" is not assignable to type "SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]"
-       "Literal['services']" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+       "Literal['services']" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/paasta/paasta_tools/tron/client.py:90:61 - error: Argument of type "Literal['config']" cannot be assigned to parameter "key" of type "SupportsIndex | slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/paasta/paasta_tools/tron/client.py:90:61 - error: Argument of type "Literal['config']" cannot be assigned to parameter "key" of type "SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     Type "Literal['config']" is not assignable to type "SupportsIndex | slice[Any, Any, Any]"
+     Type "Literal['config']" is not assignable to type "SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]"
-       "Literal['config']" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+       "Literal['config']" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)
-   .../projects/paasta/paasta_tools/tron/client.py:99:25 - error: Argument of type "Literal['hash']" cannot be assigned to parameter "key" of type "SupportsIndex | slice[Any, Any, Any]" in function "__getitem__"
+   .../projects/paasta/paasta_tools/tron/client.py:99:25 - error: Argument of type "Literal['hash']" cannot be assigned to parameter "key" of type "SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" in function "__getitem__"
-     Type "Literal['hash']" is not assignable to type "SupportsIndex | slice[Any, Any, Any]"
+     Type "Literal['hash']" is not assignable to type "SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]"
-       "Literal['hash']" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+       "Literal['hash']" is not assignable to "slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" (reportArgumentType)

bokeh (https://github.com/bokeh/bokeh)
+   .../projects/bokeh/src/bokeh/application/handlers/code.py:165:14 - error: Object of type "dict[str, Any]" cannot be used with "with" because it does not correctly implement __enter__
+     Attribute "__enter__" is unknown (reportGeneralTypeIssues)
+   .../projects/bokeh/src/bokeh/application/handlers/code.py:165:14 - error: Object of type "dict[str, Any]" cannot be used with "with" because it does not correctly implement __exit__
+     Attribute "__exit__" is unknown (reportGeneralTypeIssues)

... (truncated 1452 lines) ...```


@contextmanager
def func1(default: _A | None = None) -> Iterator[_A | str]:
def func1(default: _A | None = None) -> Generator[_A | str]:
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Newer typeshed overloads for contextmanager now prefer and treat Iterator usage there as deprecated in strict checking.

  • Keeping Iterator started producing an extra/deprecation diagnostic, so the test no longer represented intended behavior.

// of "def __new__(cls, *args, **kwargs) -> Self".
// of "def __new__(cls, *args, **kwargs) -> Self" or
// "def __new__(cls, /, *args, **kwargs) -> Self".
function isDefaultNewMethod(newMethod?: Type): boolean {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now handle '/' in default new

@bschnurr bschnurr marked this pull request as ready for review March 5, 2026 00:51
@bschnurr bschnurr requested a review from erictraut March 5, 2026 00:53
@bschnurr
Copy link
Copy Markdown
Member Author

@erictraut how do you feel about updating typeshed?

@bschnurr bschnurr merged commit 872edae into microsoft:main Mar 18, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants