Debian Codegraph @

jedi/third_party/typeshed/stdlib/typing.pyi

raw symbols SCIP
1 # Since this module defines "overload" it is not recognized by Ruff as typing.overload
2 # TODO: The collections import is required, otherwise mypy crashes.
3 # https://github.com/python/mypy/issues/16744
4 import collections # noqa: F401 # pyright: ignore[reportUnusedImport]
5 import sys
6 import typing_extensions
7 from _collections_abc import dict_items, dict_keys, dict_values
8 from _typeshed import IdentityFunction, ReadableBuffer, SupportsGetItem, SupportsGetItemViewable, SupportsKeysAndGetItem, Viewable
9 from abc import ABCMeta, abstractmethod
10 from re import Match as Match, Pattern as Pattern
11 from types import (
12 BuiltinFunctionType,
13 CodeType,
14 FunctionType,
15 GenericAlias,
16 MethodDescriptorType,
17 MethodType,
18 MethodWrapperType,
19 ModuleType,
20 TracebackType,
21 WrapperDescriptorType,
22 )
23 from typing_extensions import Never as _Never, ParamSpec as _ParamSpec, deprecated
24
25 if sys.version_info >= (3, 14):
26 from _typeshed import EvaluateFunc
27
28 from annotationlib import Format
29
30 if sys.version_info >= (3, 10):
31 from types import UnionType
32
33 __all__ = [
34 "AbstractSet",
35 "Annotated",
36 "Any",
37 "AnyStr",
38 "AsyncContextManager",
39 "AsyncGenerator",
40 "AsyncIterable",
41 "AsyncIterator",
42 "Awaitable",
43 "BinaryIO",
44 "ByteString",
45 "Callable",
46 "ChainMap",
47 "ClassVar",
48 "Collection",
49 "Container",
50 "ContextManager",
51 "Coroutine",
52 "Counter",
53 "DefaultDict",
54 "Deque",
55 "Dict",
56 "Final",
57 "ForwardRef",
58 "FrozenSet",
59 "Generator",
60 "Generic",
61 "Hashable",
62 "IO",
63 "ItemsView",
64 "Iterable",
65 "Iterator",
66 "KeysView",
67 "List",
68 "Literal",
69 "Mapping",
70 "MappingView",
71 "Match",
72 "MutableMapping",
73 "MutableSequence",
74 "MutableSet",
75 "NamedTuple",
76 "NewType",
77 "NoReturn",
78 "Optional",
79 "OrderedDict",
80 "Pattern",
81 "Protocol",
82 "Reversible",
83 "Sequence",
84 "Set",
85 "Sized",
86 "SupportsAbs",
87 "SupportsBytes",
88 "SupportsComplex",
89 "SupportsFloat",
90 "SupportsIndex",
91 "SupportsInt",
92 "SupportsRound",
93 "Text",
94 "TextIO",
95 "Tuple",
96 "Type",
97 "TypeVar",
98 "TypedDict",
99 "Union",
100 "ValuesView",
101 "TYPE_CHECKING",
102 "cast",
103 "final",
104 "get_args",
105 "get_origin",
106 "get_type_hints",
107 "no_type_check",
108 "no_type_check_decorator",
109 "overload",
110 "runtime_checkable",
111 ]
112
113 if sys.version_info >= (3, 14):
114 __all__ += ["evaluate_forward_ref"]
115
116 if sys.version_info >= (3, 10):
117 __all__ += ["Concatenate", "ParamSpec", "ParamSpecArgs", "ParamSpecKwargs", "TypeAlias", "TypeGuard", "is_typeddict"]
118
119 if sys.version_info >= (3, 11):
120 __all__ += [
121 "LiteralString",
122 "Never",
123 "NotRequired",
124 "Required",
125 "Self",
126 "TypeVarTuple",
127 "Unpack",
128 "assert_never",
129 "assert_type",
130 "clear_overloads",
131 "dataclass_transform",
132 "get_overloads",
133 "reveal_type",
134 ]
135
136 if sys.version_info >= (3, 12):
137 __all__ += ["TypeAliasType", "override"]
138
139 if sys.version_info >= (3, 13):
140 __all__ += ["get_protocol_members", "is_protocol", "NoDefault", "TypeIs", "ReadOnly"]
141
142 # We can't use this name here because it leads to issues with mypy, likely
143 # due to an import cycle. Below instead we use Any with a comment.
144 # from _typeshed import AnnotationForm
145
146 class Any: ...
147
148 class _Final:
149 __slots__ = ("__weakref__",)
150
151 def final(f: _T) -> _T: ...
152 @final
153 class TypeVar:
154 @property
155 def __name__(self) -> str: ...
156 @property
157 def __bound__(self) -> Any | None: ... # AnnotationForm
158 @property
159 def __constraints__(self) -> tuple[Any, ...]: ... # AnnotationForm
160 @property
161 def __covariant__(self) -> bool: ...
162 @property
163 def __contravariant__(self) -> bool: ...
164 if sys.version_info >= (3, 12):
165 @property
166 def __infer_variance__(self) -> bool: ...
167 if sys.version_info >= (3, 13):
168 @property
169 def __default__(self) -> Any: ... # AnnotationForm
170 if sys.version_info >= (3, 13):
171 def __new__(
172 cls,
173 name: str,
174 *constraints: Any, # AnnotationForm
175 bound: Any | None = None, # AnnotationForm
176 contravariant: bool = False,
177 covariant: bool = False,
178 infer_variance: bool = False,
179 default: Any = ..., # AnnotationForm
180 ) -> Self: ...
181 elif sys.version_info >= (3, 12):
182 def __new__(
183 cls,
184 name: str,
185 *constraints: Any, # AnnotationForm
186 bound: Any | None = None, # AnnotationForm
187 covariant: bool = False,
188 contravariant: bool = False,
189 infer_variance: bool = False,
190 ) -> Self: ...
191 elif sys.version_info >= (3, 11):
192 def __new__(
193 cls,
194 name: str,
195 *constraints: Any, # AnnotationForm
196 bound: Any | None = None, # AnnotationForm
197 covariant: bool = False,
198 contravariant: bool = False,
199 ) -> Self: ...
200 else:
201 def __init__(
202 self,
203 name: str,
204 *constraints: Any, # AnnotationForm
205 bound: Any | None = None, # AnnotationForm
206 covariant: bool = False,
207 contravariant: bool = False,
208 ) -> None: ...
209 if sys.version_info >= (3, 10):
210 def __or__(self, right: Any, /) -> _SpecialForm: ... # AnnotationForm
211 def __ror__(self, left: Any, /) -> _SpecialForm: ... # AnnotationForm
212 if sys.version_info >= (3, 11):
213 def __typing_subst__(self, arg: Any, /) -> Any: ...
214 if sys.version_info >= (3, 13):
215 def __typing_prepare_subst__(self, alias: Any, args: Any, /) -> tuple[Any, ...]: ...
216 def has_default(self) -> bool: ...
217 if sys.version_info >= (3, 14):
218 @property
219 def evaluate_bound(self) -> EvaluateFunc | None: ...
220 @property
221 def evaluate_constraints(self) -> EvaluateFunc | None: ...
222 @property
223 def evaluate_default(self) -> EvaluateFunc | None: ...
224
225 # N.B. Keep this definition in sync with typing_extensions._SpecialForm
226 @final
227 class _SpecialForm(_Final):
228 __slots__ = ("_name", "__doc__", "_getitem")
229 def __getitem__(self, parameters: Any) -> object: ...
230 if sys.version_info >= (3, 10):
231 def __or__(self, other: Any) -> _SpecialForm: ...
232 def __ror__(self, other: Any) -> _SpecialForm: ...
233
234 Union: _SpecialForm
235 Protocol: _SpecialForm
236 Callable: _SpecialForm
237 Type: _SpecialForm
238 NoReturn: _SpecialForm
239 ClassVar: _SpecialForm
240
241 Optional: _SpecialForm
242 Tuple: _SpecialForm
243 Final: _SpecialForm
244
245 Literal: _SpecialForm
246 TypedDict: _SpecialForm
247
248 if sys.version_info >= (3, 11):
249 Self: _SpecialForm
250 Never: _SpecialForm
251 Unpack: _SpecialForm
252 Required: _SpecialForm
253 NotRequired: _SpecialForm
254 LiteralString: _SpecialForm
255
256 @final
257 class TypeVarTuple:
258 @property
259 def __name__(self) -> str: ...
260 if sys.version_info >= (3, 13):
261 @property
262 def __default__(self) -> Any: ... # AnnotationForm
263 def has_default(self) -> bool: ...
264 if sys.version_info >= (3, 13):
265 def __new__(cls, name: str, *, default: Any = ...) -> Self: ... # AnnotationForm
266 elif sys.version_info >= (3, 12):
267 def __new__(cls, name: str) -> Self: ...
268 else:
269 def __init__(self, name: str) -> None: ...
270
271 def __iter__(self) -> Any: ...
272 def __typing_subst__(self, arg: Never, /) -> Never: ...
273 def __typing_prepare_subst__(self, alias: Any, args: Any, /) -> tuple[Any, ...]: ...
274 if sys.version_info >= (3, 14):
275 @property
276 def evaluate_default(self) -> EvaluateFunc | None: ...
277
278 if sys.version_info >= (3, 10):
279 @final
280 class ParamSpecArgs:
281 @property
282 def __origin__(self) -> ParamSpec: ...
283 if sys.version_info >= (3, 12):
284 def __new__(cls, origin: ParamSpec) -> Self: ...
285 else:
286 def __init__(self, origin: ParamSpec) -> None: ...
287
288 def __eq__(self, other: object, /) -> bool: ...
289 __hash__: ClassVar[None] # type: ignore[assignment]
290
291 @final
292 class ParamSpecKwargs:
293 @property
294 def __origin__(self) -> ParamSpec: ...
295 if sys.version_info >= (3, 12):
296 def __new__(cls, origin: ParamSpec) -> Self: ...
297 else:
298 def __init__(self, origin: ParamSpec) -> None: ...
299
300 def __eq__(self, other: object, /) -> bool: ...
301 __hash__: ClassVar[None] # type: ignore[assignment]
302
303 @final
304 class ParamSpec:
305 @property
306 def __name__(self) -> str: ...
307 @property
308 def __bound__(self) -> Any | None: ... # AnnotationForm
309 @property
310 def __covariant__(self) -> bool: ...
311 @property
312 def __contravariant__(self) -> bool: ...
313 if sys.version_info >= (3, 12):
314 @property
315 def __infer_variance__(self) -> bool: ...
316 if sys.version_info >= (3, 13):
317 @property
318 def __default__(self) -> Any: ... # AnnotationForm
319 if sys.version_info >= (3, 13):
320 def __new__(
321 cls,
322 name: str,
323 *,
324 bound: Any | None = None, # AnnotationForm
325 contravariant: bool = False,
326 covariant: bool = False,
327 infer_variance: bool = False,
328 default: Any = ..., # AnnotationForm
329 ) -> Self: ...
330 elif sys.version_info >= (3, 12):
331 def __new__(
332 cls,
333 name: str,
334 *,
335 bound: Any | None = None, # AnnotationForm
336 contravariant: bool = False,
337 covariant: bool = False,
338 infer_variance: bool = False,
339 ) -> Self: ...
340 elif sys.version_info >= (3, 11):
341 def __new__(
342 cls,
343 name: str,
344 *,
345 bound: Any | None = None, # AnnotationForm
346 contravariant: bool = False,
347 covariant: bool = False,
348 ) -> Self: ...
349 else:
350 def __init__(
351 self,
352 name: str,
353 *,
354 bound: Any | None = None, # AnnotationForm
355 contravariant: bool = False,
356 covariant: bool = False,
357 ) -> None: ...
358
359 @property
360 def args(self) -> ParamSpecArgs: ...
361 @property
362 def kwargs(self) -> ParamSpecKwargs: ...
363 if sys.version_info >= (3, 11):
364 def __typing_subst__(self, arg: Any, /) -> Any: ...
365 def __typing_prepare_subst__(self, alias: Any, args: Any, /) -> tuple[Any, ...]: ...
366
367 def __or__(self, right: Any, /) -> _SpecialForm: ...
368 def __ror__(self, left: Any, /) -> _SpecialForm: ...
369 if sys.version_info >= (3, 13):
370 def has_default(self) -> bool: ...
371 if sys.version_info >= (3, 14):
372 @property
373 def evaluate_default(self) -> EvaluateFunc | None: ...
374
375 Concatenate: _SpecialForm
376 TypeAlias: _SpecialForm
377 TypeGuard: _SpecialForm
378
379 class NewType:
380 def __init__(self, name: str, tp: Any) -> None: ... # AnnotationForm
381 if sys.version_info >= (3, 11):
382 @staticmethod
383 def __call__(x: _T, /) -> _T: ...
384 else:
385 def __call__(self, x: _T) -> _T: ...
386
387 def __or__(self, other: Any) -> _SpecialForm: ...
388 def __ror__(self, other: Any) -> _SpecialForm: ...
389 __supertype__: type | NewType
390 __name__: str
391
392 else:
393 def NewType(name: str, tp: Any) -> Any: ...
394
395 _F = TypeVar("_F", bound=Callable[..., Any])
396 _P = _ParamSpec("_P")
397 _T = TypeVar("_T")
398
399 _FT = TypeVar("_FT", bound=Callable[..., Any] | type)
400
401 # These type variables are used by the container types.
402 _S = TypeVar("_S")
403 _KT = TypeVar("_KT") # Key type.
404 _VT = TypeVar("_VT") # Value type.
405 _T_co = TypeVar("_T_co", covariant=True) # Any type covariant containers.
406 _KT_co = TypeVar("_KT_co", covariant=True) # Key type covariant containers.
407 _VT_co = TypeVar("_VT_co", covariant=True) # Value type covariant containers.
408 _TC = TypeVar("_TC", bound=type[object])
409
410 def overload(func: _F) -> _F: ...
411 def no_type_check(arg: _F) -> _F: ...
412
413 if sys.version_info >= (3, 13):
414 @deprecated("Deprecated since Python 3.13; removed in Python 3.15.")
415 def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ...
416
417 else:
418 def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ...
419
420 # This itself is only available during type checking
421 def type_check_only(func_or_cls: _FT) -> _FT: ...
422
423 # Type aliases and type constructors
424
425 @type_check_only
426 class _Alias:
427 # Class for defining generic aliases for library types.
428 def __getitem__(self, typeargs: Any) -> Any: ...
429
430 List = _Alias()
431 Dict = _Alias()
432 DefaultDict = _Alias()
433 Set = _Alias()
434 FrozenSet = _Alias()
435 Counter = _Alias()
436 Deque = _Alias()
437 ChainMap = _Alias()
438
439 OrderedDict = _Alias()
440
441 Annotated: _SpecialForm
442
443 # Predefined type variables.
444 AnyStr = TypeVar("AnyStr", str, bytes) # noqa: Y001
445
446 @type_check_only
447 class _Generic:
448 if sys.version_info < (3, 12):
449 __slots__ = ()
450
451 if sys.version_info >= (3, 10):
452 @classmethod
453 def __class_getitem__(cls, args: TypeVar | ParamSpec | tuple[TypeVar | ParamSpec, ...]) -> _Final: ...
454 else:
455 @classmethod
456 def __class_getitem__(cls, args: TypeVar | tuple[TypeVar, ...]) -> _Final: ...
457
458 Generic: type[_Generic]
459
460 class _ProtocolMeta(ABCMeta):
461 if sys.version_info >= (3, 12):
462 def __init__(cls, *args: Any, **kwargs: Any) -> None: ...
463
464 # Abstract base classes.
465
466 def runtime_checkable(cls: _TC) -> _TC: ...
467 @runtime_checkable
468 class SupportsInt(Protocol, metaclass=ABCMeta):
469 __slots__ = ()
470 @abstractmethod
471 def __int__(self) -> int: ...
472
473 @runtime_checkable
474 class SupportsFloat(Protocol, metaclass=ABCMeta):
475 __slots__ = ()
476 @abstractmethod
477 def __float__(self) -> float: ...
478
479 @runtime_checkable
480 class SupportsComplex(Protocol, metaclass=ABCMeta):
481 __slots__ = ()
482 @abstractmethod
483 def __complex__(self) -> complex: ...
484
485 @runtime_checkable
486 class SupportsBytes(Protocol, metaclass=ABCMeta):
487 __slots__ = ()
488 @abstractmethod
489 def __bytes__(self) -> bytes: ...
490
491 @runtime_checkable
492 class SupportsIndex(Protocol, metaclass=ABCMeta):
493 __slots__ = ()
494 @abstractmethod
495 def __index__(self) -> int: ...
496
497 @runtime_checkable
498 class SupportsAbs(Protocol[_T_co]):
499 __slots__ = ()
500 @abstractmethod
501 def __abs__(self) -> _T_co: ...
502
503 @runtime_checkable
504 class SupportsRound(Protocol[_T_co]):
505 __slots__ = ()
506 @overload
507 @abstractmethod
508 def __round__(self) -> int: ...
509 @overload
510 @abstractmethod
511 def __round__(self, ndigits: int, /) -> _T_co: ...
512
513 @runtime_checkable
514 class Sized(Protocol, metaclass=ABCMeta):
515 @abstractmethod
516 def __len__(self) -> int: ...
517
518 @runtime_checkable
519 class Hashable(Protocol, metaclass=ABCMeta):
520 # TODO: This is special, in that a subclass of a hashable class may not be hashable
521 # (for example, list vs. object). It's not obvious how to represent this. This class
522 # is currently mostly useless for static checking.
523 @abstractmethod
524 def __hash__(self) -> int: ...
525
526 @runtime_checkable
527 class Iterable(Protocol[_T_co]):
528 @abstractmethod
529 def __iter__(self) -> Iterator[_T_co]: ...
530
531 @runtime_checkable
532 class Iterator(Iterable[_T_co], Protocol[_T_co]):
533 @abstractmethod
534 def __next__(self) -> _T_co: ...
535 def __iter__(self) -> Iterator[_T_co]: ...
536
537 @runtime_checkable
538 class Reversible(Iterable[_T_co], Protocol[_T_co]):
539 @abstractmethod
540 def __reversed__(self) -> Iterator[_T_co]: ...
541
542 _YieldT_co = TypeVar("_YieldT_co", covariant=True)
543 _SendT_contra = TypeVar("_SendT_contra", contravariant=True, default=None)
544 _ReturnT_co = TypeVar("_ReturnT_co", covariant=True, default=None)
545
546 @runtime_checkable
547 class Generator(Iterator[_YieldT_co], Protocol[_YieldT_co, _SendT_contra, _ReturnT_co]):
548 def __next__(self) -> _YieldT_co: ...
549 @abstractmethod
550 def send(self, value: _SendT_contra, /) -> _YieldT_co: ...
551 @overload
552 @abstractmethod
553 def throw(
554 self, typ: type[BaseException], val: BaseException | object = None, tb: TracebackType | None = None, /
555 ) -> _YieldT_co: ...
556 @overload
557 @abstractmethod
558 def throw(self, typ: BaseException, val: None = None, tb: TracebackType | None = None, /) -> _YieldT_co: ...
559 if sys.version_info >= (3, 13):
560 def close(self) -> _ReturnT_co | None: ...
561 else:
562 def close(self) -> None: ...
563
564 def __iter__(self) -> Generator[_YieldT_co, _SendT_contra, _ReturnT_co]: ...
565
566 # NOTE: Prior to Python 3.13 these aliases are lacking the second _ExitT_co parameter
567 if sys.version_info >= (3, 13):
568 from contextlib import AbstractAsyncContextManager as AsyncContextManager, AbstractContextManager as ContextManager
569 else:
570 from contextlib import AbstractAsyncContextManager, AbstractContextManager
571
572 @runtime_checkable
573 class ContextManager(AbstractContextManager[_T_co, bool | None], Protocol[_T_co]): ...
574
575 @runtime_checkable
576 class AsyncContextManager(AbstractAsyncContextManager[_T_co, bool | None], Protocol[_T_co]): ...
577
578 @runtime_checkable
579 class Awaitable(Protocol[_T_co]):
580 @abstractmethod
581 def __await__(self) -> Generator[Any, Any, _T_co]: ...
582
583 # Non-default variations to accommodate coroutines, and `AwaitableGenerator` having a 4th type parameter.
584 _SendT_nd_contra = TypeVar("_SendT_nd_contra", contravariant=True)
585 _ReturnT_nd_co = TypeVar("_ReturnT_nd_co", covariant=True)
586
587 class Coroutine(Awaitable[_ReturnT_nd_co], Generic[_YieldT_co, _SendT_nd_contra, _ReturnT_nd_co]):
588 __name__: str
589 __qualname__: str
590
591 @abstractmethod
592 def send(self, value: _SendT_nd_contra, /) -> _YieldT_co: ...
593 @overload
594 @abstractmethod
595 def throw(
596 self, typ: type[BaseException], val: BaseException | object = None, tb: TracebackType | None = None, /
597 ) -> _YieldT_co: ...
598 @overload
599 @abstractmethod
600 def throw(self, typ: BaseException, val: None = None, tb: TracebackType | None = None, /) -> _YieldT_co: ...
601 @abstractmethod
602 def close(self) -> None: ...
603
604 # NOTE: This type does not exist in typing.py or PEP 484 but mypy needs it to exist.
605 # The parameters correspond to Generator, but the 4th is the original type.
606 # Obsolete, use _typeshed._type_checker_internals.AwaitableGenerator instead.
607 @type_check_only
608 class AwaitableGenerator(
609 Awaitable[_ReturnT_nd_co],
610 Generator[_YieldT_co, _SendT_nd_contra, _ReturnT_nd_co],
611 Generic[_YieldT_co, _SendT_nd_contra, _ReturnT_nd_co, _S],
612 metaclass=ABCMeta,
613 ): ...
614
615 @runtime_checkable
616 class AsyncIterable(Protocol[_T_co]):
617 @abstractmethod
618 def __aiter__(self) -> AsyncIterator[_T_co]: ...
619
620 @runtime_checkable
621 class AsyncIterator(AsyncIterable[_T_co], Protocol[_T_co]):
622 @abstractmethod
623 def __anext__(self) -> Awaitable[_T_co]: ...
624 def __aiter__(self) -> AsyncIterator[_T_co]: ...
625
626 @runtime_checkable
627 class AsyncGenerator(AsyncIterator[_YieldT_co], Protocol[_YieldT_co, _SendT_contra]):
628 def __anext__(self) -> Coroutine[Any, Any, _YieldT_co]: ...
629 @abstractmethod
630 def asend(self, value: _SendT_contra, /) -> Coroutine[Any, Any, _YieldT_co]: ...
631 @overload
632 @abstractmethod
633 def athrow(
634 self, typ: type[BaseException], val: BaseException | object = None, tb: TracebackType | None = None, /
635 ) -> Coroutine[Any, Any, _YieldT_co]: ...
636 @overload
637 @abstractmethod
638 def athrow(
639 self, typ: BaseException, val: None = None, tb: TracebackType | None = None, /
640 ) -> Coroutine[Any, Any, _YieldT_co]: ...
641 def aclose(self) -> Coroutine[Any, Any, None]: ...
642
643 _ContainerT_contra = TypeVar("_ContainerT_contra", contravariant=True, default=Any)
644
645 @runtime_checkable
646 class Container(Protocol[_ContainerT_contra]):
647 # This is generic more on vibes than anything else
648 @abstractmethod
649 def __contains__(self, x: _ContainerT_contra, /) -> bool: ...
650
651 @runtime_checkable
652 class Collection(Iterable[_T_co], Container[Any], Protocol[_T_co]):
653 # Note: need to use Container[Any] instead of Container[_T_co] to ensure covariance.
654 # Implement Sized (but don't have it as a base class).
655 @abstractmethod
656 def __len__(self) -> int: ...
657
658 class Sequence(Reversible[_T_co], Collection[_T_co]):
659 @overload
660 @abstractmethod
661 def __getitem__(self, index: int, /) -> _T_co: ...
662 @overload
663 @abstractmethod
664 def __getitem__(self, index: slice[int | None], /) -> Sequence[_T_co]: ...
665 # Mixin methods
666 def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ...
667 def count(self, value: Any, /) -> int: ...
668 def __contains__(self, value: object, /) -> bool: ...
669 def __iter__(self) -> Iterator[_T_co]: ...
670 def __reversed__(self) -> Iterator[_T_co]: ...
671
672 class MutableSequence(Sequence[_T]):
673 @abstractmethod
674 def insert(self, index: int, value: _T, /) -> None: ...
675 @overload
676 @abstractmethod
677 def __getitem__(self, index: int, /) -> _T: ...
678 @overload
679 @abstractmethod
680 def __getitem__(self, index: slice[int | None], /) -> MutableSequence[_T]: ...
681 @overload
682 @abstractmethod
683 def __setitem__(self, index: int, value: _T, /) -> None: ...
684 @overload
685 @abstractmethod
686 def __setitem__(self, index: slice[int | None], value: Iterable[_T], /) -> None: ...
687 @overload
688 @abstractmethod
689 def __delitem__(self, index: int, /) -> None: ...
690 @overload
691 @abstractmethod
692 def __delitem__(self, index: slice[int | None], /) -> None: ...
693 # Mixin methods
694 def append(self, value: _T, /) -> None: ...
695 def clear(self) -> None: ...
696 def extend(self, values: Iterable[_T], /) -> None: ...
697 def reverse(self) -> None: ...
698 def pop(self, index: int = -1, /) -> _T: ...
699 def remove(self, value: _T, /) -> None: ...
700 def __iadd__(self, values: Iterable[_T], /) -> typing_extensions.Self: ...
701
702 class AbstractSet(Collection[_T_co]):
703 @abstractmethod
704 def __contains__(self, x: object, /) -> bool: ...
705 def _hash(self) -> int: ...
706 # Mixin methods
707 @classmethod
708 def _from_iterable(cls, it: Iterable[_S], /) -> AbstractSet[_S]: ...
709 def __le__(self, other: AbstractSet[Any], /) -> bool: ...
710 def __lt__(self, other: AbstractSet[Any], /) -> bool: ...
711 def __gt__(self, other: AbstractSet[Any], /) -> bool: ...
712 def __ge__(self, other: AbstractSet[Any], /) -> bool: ...
713 def __and__(self, other: AbstractSet[Any], /) -> AbstractSet[_T_co]: ...
714 def __or__(self, other: AbstractSet[_T], /) -> AbstractSet[_T_co | _T]: ...
715 def __sub__(self, other: AbstractSet[Any], /) -> AbstractSet[_T_co]: ...
716 def __xor__(self, other: AbstractSet[_T], /) -> AbstractSet[_T_co | _T]: ...
717 def __eq__(self, other: object, /) -> bool: ...
718 def isdisjoint(self, other: Iterable[Any], /) -> bool: ...
719
720 class MutableSet(AbstractSet[_T]):
721 @abstractmethod
722 def add(self, value: _T, /) -> None: ...
723 @abstractmethod
724 def discard(self, value: _T, /) -> None: ...
725 # Mixin methods
726 def clear(self) -> None: ...
727 def pop(self) -> _T: ...
728 def remove(self, value: _T, /) -> None: ...
729 def __ior__(self, it: AbstractSet[_T], /) -> typing_extensions.Self: ... # type: ignore[override,misc]
730 def __iand__(self, it: AbstractSet[Any], /) -> typing_extensions.Self: ...
731 def __ixor__(self, it: AbstractSet[_T], /) -> typing_extensions.Self: ... # type: ignore[override,misc]
732 def __isub__(self, it: AbstractSet[Any], /) -> typing_extensions.Self: ...
733
734 class MappingView(Sized):
735 __slots__ = ("_mapping",)
736 def __init__(self, mapping: Sized) -> None: ... # undocumented
737 def __len__(self) -> int: ...
738
739 class ItemsView(MappingView, AbstractSet[tuple[_KT_co, _VT_co]], Generic[_KT_co, _VT_co]):
740 def __init__(self, mapping: SupportsGetItemViewable[_KT_co, _VT_co]) -> None: ... # undocumented
741 @classmethod
742 def _from_iterable(cls, it: Iterable[_S], /) -> set[_S]: ...
743 def __and__(self, other: Iterable[Any], /) -> set[tuple[_KT_co, _VT_co]]: ...
744 def __rand__(self, other: Iterable[_T], /) -> set[_T]: ...
745 def __contains__(self, item: tuple[object, object], /) -> bool: ... # type: ignore[override]
746 def __iter__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ...
747 def __or__(self, other: Iterable[_T], /) -> set[tuple[_KT_co, _VT_co] | _T]: ...
748 def __ror__(self, other: Iterable[_T], /) -> set[tuple[_KT_co, _VT_co] | _T]: ...
749 def __sub__(self, other: Iterable[Any], /) -> set[tuple[_KT_co, _VT_co]]: ...
750 def __rsub__(self, other: Iterable[_T], /) -> set[_T]: ...
751 def __xor__(self, other: Iterable[_T], /) -> set[tuple[_KT_co, _VT_co] | _T]: ...
752 def __rxor__(self, other: Iterable[_T], /) -> set[tuple[_KT_co, _VT_co] | _T]: ...
753
754 class KeysView(MappingView, AbstractSet[_KT_co]):
755 def __init__(self, mapping: Viewable[_KT_co]) -> None: ... # undocumented
756 @classmethod
757 def _from_iterable(cls, it: Iterable[_S], /) -> set[_S]: ...
758 def __and__(self, other: Iterable[Any], /) -> set[_KT_co]: ...
759 def __rand__(self, other: Iterable[_T], /) -> set[_T]: ...
760 def __contains__(self, key: object, /) -> bool: ...
761 def __iter__(self) -> Iterator[_KT_co]: ...
762 def __or__(self, other: Iterable[_T], /) -> set[_KT_co | _T]: ...
763 def __ror__(self, other: Iterable[_T], /) -> set[_KT_co | _T]: ...
764 def __sub__(self, other: Iterable[Any], /) -> set[_KT_co]: ...
765 def __rsub__(self, other: Iterable[_T], /) -> set[_T]: ...
766 def __xor__(self, other: Iterable[_T], /) -> set[_KT_co | _T]: ...
767 def __rxor__(self, other: Iterable[_T], /) -> set[_KT_co | _T]: ...
768
769 class ValuesView(MappingView, Collection[_VT_co]):
770 def __init__(self, mapping: SupportsGetItemViewable[Any, _VT_co]) -> None: ... # undocumented
771 def __contains__(self, value: object, /) -> bool: ...
772 def __iter__(self) -> Iterator[_VT_co]: ...
773
774 # note for Mapping.get and MutableMapping.pop and MutableMapping.setdefault
775 # In _collections_abc.py the parameters are positional-or-keyword,
776 # but dict and types.MappingProxyType (the vast majority of Mapping types)
777 # don't allow keyword arguments.
778
779 class Mapping(Generic[_KT, _VT_co], Collection[_KT]):
780 # TODO: We wish the key type could also be covariant, but that doesn't work,
781 # see discussion in https://github.com/python/typing/pull/273.
782 @abstractmethod
783 def __getitem__(self, key: _KT, /) -> _VT_co: ...
784 # Mixin methods
785 @overload
786 def get(self, key: _KT, /) -> _VT_co | None: ...
787 @overload
788 def get(self, key: _KT, default: _VT_co, /) -> _VT_co: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] # Covariant type as parameter
789 @overload
790 def get(self, key: _KT, default: _T, /) -> _VT_co | _T: ...
791 def items(self) -> ItemsView[_KT, _VT_co]: ...
792 def keys(self) -> KeysView[_KT]: ...
793 def values(self) -> ValuesView[_VT_co]: ...
794 def __contains__(self, key: object, /) -> bool: ...
795 def __eq__(self, other: object, /) -> bool: ...
796
797 class MutableMapping(Mapping[_KT, _VT]):
798 @abstractmethod
799 def __setitem__(self, key: _KT, value: _VT, /) -> None: ...
800 @abstractmethod
801 def __delitem__(self, key: _KT, /) -> None: ...
802 def clear(self) -> None: ...
803 @overload
804 def pop(self, key: _KT, /) -> _VT: ...
805 @overload
806 def pop(self, key: _KT, default: _VT, /) -> _VT: ...
807 @overload
808 def pop(self, key: _KT, default: _T, /) -> _VT | _T: ...
809 def popitem(self) -> tuple[_KT, _VT]: ...
810 # This overload should be allowed only if the value type is compatible with None.
811 #
812 # Keep the following methods in line with MutableMapping.setdefault, modulo positional-only differences:
813 # -- collections.OrderedDict.setdefault
814 # -- collections.ChainMap.setdefault
815 # -- weakref.WeakKeyDictionary.setdefault
816 @overload
817 def setdefault(self: MutableMapping[_KT, _T | None], key: _KT, default: None = None, /) -> _T | None: ...
818 @overload
819 def setdefault(self, key: _KT, default: _VT, /) -> _VT: ...
820 # 'update' used to take a Union, but using overloading is better.
821 # The second overloaded type here is a bit too general, because
822 # Mapping[tuple[_KT, _VT], W] is a subclass of Iterable[tuple[_KT, _VT]],
823 # but will always have the behavior of the first overloaded type
824 # at runtime, leading to keys of a mix of types _KT and tuple[_KT, _VT].
825 # We don't currently have any way of forcing all Mappings to use
826 # the first overload, but by using overloading rather than a Union,
827 # mypy will commit to using the first overload when the argument is
828 # known to be a Mapping with unknown type parameters, which is closer
829 # to the behavior we want. See mypy issue #1430.
830 #
831 # Various mapping classes have __ior__ methods that should be kept roughly in line with .update():
832 # -- dict.__ior__
833 # -- os._Environ.__ior__
834 # -- collections.UserDict.__ior__
835 # -- collections.ChainMap.__ior__
836 # -- peewee.attrdict.__add__
837 # -- peewee.attrdict.__iadd__
838 # -- weakref.WeakValueDictionary.__ior__
839 # -- weakref.WeakKeyDictionary.__ior__
840 @overload
841 def update(self, m: SupportsKeysAndGetItem[_KT, _VT], /) -> None: ...
842 @overload
843 def update(self: SupportsGetItem[str, _VT], m: SupportsKeysAndGetItem[str, _VT], /, **kwargs: _VT) -> None: ...
844 @overload
845 def update(self, m: Iterable[tuple[_KT, _VT]], /) -> None: ...
846 @overload
847 def update(self: SupportsGetItem[str, _VT], m: Iterable[tuple[str, _VT]], /, **kwargs: _VT) -> None: ...
848 @overload
849 def update(self: SupportsGetItem[str, _VT], /, **kwargs: _VT) -> None: ...
850
851 Text = str
852
853 TYPE_CHECKING: Final[bool]
854
855 # In stubs, the arguments of the IO class are marked as positional-only.
856 # This differs from runtime, but better reflects the fact that in reality
857 # classes deriving from IO use different names for the arguments.
858 class IO(Generic[AnyStr]):
859 # At runtime these are all abstract properties,
860 # but making them abstract in the stub is hugely disruptive, for not much gain.
861 # See #8726
862 __slots__ = ()
863 @property
864 def mode(self) -> str: ...
865 # Usually str, but may be bytes if a bytes path was passed to open(). See #10737.
866 # If PEP 696 becomes available, we may want to use a defaulted TypeVar here.
867 @property
868 def name(self) -> str | Any: ...
869 @abstractmethod
870 def close(self) -> None: ...
871 @property
872 def closed(self) -> bool: ...
873 @abstractmethod
874 def fileno(self) -> int: ...
875 @abstractmethod
876 def flush(self) -> None: ...
877 @abstractmethod
878 def isatty(self) -> bool: ...
879 @abstractmethod
880 def read(self, n: int = -1, /) -> AnyStr: ...
881 @abstractmethod
882 def readable(self) -> bool: ...
883 @abstractmethod
884 def readline(self, limit: int = -1, /) -> AnyStr: ...
885 @abstractmethod
886 def readlines(self, hint: int = -1, /) -> list[AnyStr]: ...
887 @abstractmethod
888 def seek(self, offset: int, whence: int = 0, /) -> int: ...
889 @abstractmethod
890 def seekable(self) -> bool: ...
891 @abstractmethod
892 def tell(self) -> int: ...
893 @abstractmethod
894 def truncate(self, size: int | None = None, /) -> int: ...
895 @abstractmethod
896 def writable(self) -> bool: ...
897 @abstractmethod
898 @overload
899 def write(self: IO[bytes], s: ReadableBuffer, /) -> int: ...
900 @abstractmethod
901 @overload
902 def write(self, s: AnyStr, /) -> int: ...
903 @abstractmethod
904 @overload
905 def writelines(self: IO[bytes], lines: Iterable[ReadableBuffer], /) -> None: ...
906 @abstractmethod
907 @overload
908 def writelines(self, lines: Iterable[AnyStr], /) -> None: ...
909 @abstractmethod
910 def __next__(self) -> AnyStr: ...
911 @abstractmethod
912 def __iter__(self) -> Iterator[AnyStr]: ...
913 @abstractmethod
914 def __enter__(self) -> IO[AnyStr]: ...
915 @abstractmethod
916 def __exit__(
917 self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None, /
918 ) -> None: ...
919
920 class BinaryIO(IO[bytes]):
921 __slots__ = ()
922 @abstractmethod
923 def __enter__(self) -> BinaryIO: ...
924
925 class TextIO(IO[str]):
926 # See comment regarding the @properties in the `IO` class
927 __slots__ = ()
928 @property
929 def buffer(self) -> BinaryIO: ...
930 @property
931 def encoding(self) -> str: ...
932 @property
933 def errors(self) -> str | None: ...
934 @property
935 def line_buffering(self) -> int: ... # int on PyPy, bool on CPython
936 @property
937 def newlines(self) -> Any: ... # None, str or tuple
938 @abstractmethod
939 def __enter__(self) -> TextIO: ...
940
941 ByteString: typing_extensions.TypeAlias = bytes | bytearray | memoryview
942
943 # Functions
944
945 _get_type_hints_obj_allowed_types: typing_extensions.TypeAlias = ( # noqa: Y042
946 object
947 | Callable[..., Any]
948 | FunctionType
949 | BuiltinFunctionType
950 | MethodType
951 | ModuleType
952 | WrapperDescriptorType
953 | MethodWrapperType
954 | MethodDescriptorType
955 )
956
957 if sys.version_info >= (3, 14):
958 def get_type_hints(
959 obj: _get_type_hints_obj_allowed_types,
960 globalns: dict[str, Any] | None = None,
961 localns: Mapping[str, Any] | None = None,
962 include_extras: bool = False,
963 *,
964 format: Format | None = None, # Default: Format.VALUE
965 ) -> dict[str, Any]: ... # AnnotationForm
966
967 else:
968 def get_type_hints(
969 obj: _get_type_hints_obj_allowed_types,
970 globalns: dict[str, Any] | None = None,
971 localns: Mapping[str, Any] | None = None,
972 include_extras: bool = False,
973 ) -> dict[str, Any]: ... # AnnotationForm
974
975 def get_args(tp: Any) -> tuple[Any, ...]: ... # AnnotationForm
976
977 if sys.version_info >= (3, 10):
978 @overload
979 def get_origin(tp: ParamSpecArgs | ParamSpecKwargs) -> ParamSpec: ...
980 @overload
981 def get_origin(tp: UnionType) -> type[UnionType]: ...
982
983 @overload
984 def get_origin(tp: GenericAlias) -> type: ...
985 @overload
986 def get_origin(tp: Any) -> Any | None: ... # AnnotationForm
987 @overload
988 def cast(typ: type[_T], val: Any) -> _T: ...
989 @overload
990 def cast(typ: str, val: Any) -> Any: ...
991 @overload
992 def cast(typ: object, val: Any) -> Any: ...
993
994 if sys.version_info >= (3, 11):
995 def reveal_type(obj: _T, /) -> _T: ...
996 def assert_never(arg: Never, /) -> Never: ...
997 def assert_type(val: _T, typ: Any, /) -> _T: ... # AnnotationForm
998 def clear_overloads() -> None: ...
999 def get_overloads(func: Callable[..., object]) -> Sequence[Callable[..., object]]: ...
1000 def dataclass_transform(
1001 *,
1002 eq_default: bool = True,
1003 order_default: bool = False,
1004 kw_only_default: bool = False,
1005 frozen_default: bool = False, # on 3.11, runtime accepts it as part of kwargs
1006 field_specifiers: tuple[type[Any] | Callable[..., Any], ...] = (),
1007 **kwargs: Any,
1008 ) -> IdentityFunction: ...
1009
1010 # Type constructors
1011
1012 # Obsolete, will be changed to a function. Use _typeshed._type_checker_internals.NamedTupleFallback instead.
1013 class NamedTuple(tuple[Any, ...]):
1014 _field_defaults: ClassVar[dict[str, Any]]
1015 _fields: ClassVar[tuple[str, ...]]
1016 # __orig_bases__ sometimes exists on <3.12, but not consistently
1017 # So we only add it to the stub on 3.12+.
1018 if sys.version_info >= (3, 12):
1019 __orig_bases__: ClassVar[tuple[Any, ...]]
1020
1021 @overload
1022 def __init__(self, typename: str, fields: Iterable[tuple[str, Any]], /) -> None: ...
1023 @overload
1024 @deprecated("Creating a typing.NamedTuple using keyword arguments is deprecated and support will be removed in Python 3.15")
1025 def __init__(self, typename: str, fields: None = None, /, **kwargs: Any) -> None: ...
1026 @classmethod
1027 def _make(cls, iterable: Iterable[Any]) -> typing_extensions.Self: ...
1028 def _asdict(self) -> dict[str, Any]: ...
1029 def _replace(self, **kwargs: Any) -> typing_extensions.Self: ...
1030 if sys.version_info >= (3, 13):
1031 def __replace__(self, **kwargs: Any) -> typing_extensions.Self: ...
1032
1033 # Internal mypy fallback type for all typed dicts (does not exist at runtime)
1034 # N.B. Keep this mostly in sync with typing_extensions._TypedDict/mypy_extensions._TypedDict
1035 # Obsolete, use _typeshed._type_checker_internals.TypedDictFallback instead.
1036 @type_check_only
1037 class _TypedDict(Mapping[str, object], metaclass=ABCMeta):
1038 __total__: ClassVar[bool]
1039 __required_keys__: ClassVar[frozenset[str]]
1040 __optional_keys__: ClassVar[frozenset[str]]
1041 # __orig_bases__ sometimes exists on <3.12, but not consistently,
1042 # so we only add it to the stub on 3.12+
1043 if sys.version_info >= (3, 12):
1044 __orig_bases__: ClassVar[tuple[Any, ...]]
1045 if sys.version_info >= (3, 13):
1046 __readonly_keys__: ClassVar[frozenset[str]]
1047 __mutable_keys__: ClassVar[frozenset[str]]
1048
1049 def copy(self) -> typing_extensions.Self: ...
1050 # Using Never so that only calls using mypy plugin hook that specialize the signature
1051 # can go through.
1052 def setdefault(self, k: _Never, default: object) -> object: ...
1053 # Mypy plugin hook for 'pop' expects that 'default' has a type variable type.
1054 def pop(self, k: _Never, default: _T = ...) -> object: ... # pyright: ignore[reportInvalidTypeVarUse]
1055 def update(self, m: typing_extensions.Self, /) -> None: ...
1056 def __delitem__(self, k: _Never) -> None: ...
1057 def items(self) -> dict_items[str, object]: ...
1058 def keys(self) -> dict_keys[str, object]: ...
1059 def values(self) -> dict_values[str, object]: ...
1060 @overload
1061 def __or__(self, value: typing_extensions.Self, /) -> typing_extensions.Self: ...
1062 @overload
1063 def __or__(self, value: dict[str, Any], /) -> dict[str, object]: ...
1064 @overload
1065 def __ror__(self, value: typing_extensions.Self, /) -> typing_extensions.Self: ...
1066 @overload
1067 def __ror__(self, value: dict[str, Any], /) -> dict[str, object]: ...
1068 # supposedly incompatible definitions of __or__ and __ior__
1069 def __ior__(self, value: typing_extensions.Self, /) -> typing_extensions.Self: ... # type: ignore[misc]
1070
1071 if sys.version_info >= (3, 14):
1072 from annotationlib import ForwardRef as ForwardRef
1073
1074 def evaluate_forward_ref(
1075 forward_ref: ForwardRef,
1076 *,
1077 owner: object = None,
1078 globals: dict[str, Any] | None = None,
1079 locals: Mapping[str, Any] | None = None,
1080 type_params: tuple[TypeVar, ParamSpec, TypeVarTuple] | None = None,
1081 format: Format | None = None,
1082 ) -> Any: ... # AnnotationForm
1083
1084 else:
1085 @final
1086 class ForwardRef(_Final):
1087 __slots__ = (
1088 "__forward_arg__",
1089 "__forward_code__",
1090 "__forward_evaluated__",
1091 "__forward_value__",
1092 "__forward_is_argument__",
1093 "__forward_is_class__",
1094 "__forward_module__",
1095 )
1096 __forward_arg__: str
1097 __forward_code__: CodeType
1098 __forward_evaluated__: bool
1099 __forward_value__: Any | None # AnnotationForm
1100 __forward_is_argument__: bool
1101 __forward_is_class__: bool
1102 __forward_module__: Any | None
1103
1104 def __init__(self, arg: str, is_argument: bool = True, module: Any | None = None, *, is_class: bool = False) -> None: ...
1105
1106 if sys.version_info >= (3, 13):
1107 @overload
1108 @deprecated(
1109 "Failing to pass a value to the 'type_params' parameter of ForwardRef._evaluate() is deprecated, "
1110 "as it leads to incorrect behaviour when evaluating a stringified annotation "
1111 "that references a PEP 695 type parameter. It will be disallowed in Python 3.15."
1112 )
1113 def _evaluate(
1114 self, globalns: dict[str, Any] | None, localns: Mapping[str, Any] | None, *, recursive_guard: frozenset[str]
1115 ) -> Any | None: ... # AnnotationForm
1116 @overload
1117 def _evaluate(
1118 self,
1119 globalns: dict[str, Any] | None,
1120 localns: Mapping[str, Any] | None,
1121 type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...],
1122 *,
1123 recursive_guard: frozenset[str],
1124 ) -> Any | None: ... # AnnotationForm
1125 elif sys.version_info >= (3, 12):
1126 def _evaluate(
1127 self,
1128 globalns: dict[str, Any] | None,
1129 localns: Mapping[str, Any] | None,
1130 type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...] | None = None,
1131 *,
1132 recursive_guard: frozenset[str],
1133 ) -> Any | None: ... # AnnotationForm
1134 else:
1135 def _evaluate(
1136 self, globalns: dict[str, Any] | None, localns: Mapping[str, Any] | None, recursive_guard: frozenset[str]
1137 ) -> Any | None: ... # AnnotationForm
1138
1139 def __eq__(self, other: object) -> bool: ...
1140 def __hash__(self) -> int: ...
1141 if sys.version_info >= (3, 11):
1142 def __or__(self, other: Any) -> _SpecialForm: ...
1143 def __ror__(self, other: Any) -> _SpecialForm: ...
1144
1145 if sys.version_info >= (3, 10):
1146 def is_typeddict(tp: object) -> bool: ...
1147
1148 def _type_repr(obj: object) -> str: ...
1149
1150 if sys.version_info >= (3, 12):
1151 _TypeParameter: typing_extensions.TypeAlias = (
1152 TypeVar
1153 | typing_extensions.TypeVar
1154 | ParamSpec
1155 | typing_extensions.ParamSpec
1156 | TypeVarTuple
1157 | typing_extensions.TypeVarTuple
1158 )
1159
1160 def override(method: _F, /) -> _F: ...
1161 @final
1162 class TypeAliasType:
1163 def __new__(cls, name: str, value: Any, *, type_params: tuple[_TypeParameter, ...] = ()) -> Self: ...
1164 @property
1165 def __value__(self) -> Any: ... # AnnotationForm
1166 @property
1167 def __type_params__(self) -> tuple[_TypeParameter, ...]: ...
1168 @property
1169 def __parameters__(self) -> tuple[Any, ...]: ... # AnnotationForm
1170 @property
1171 def __name__(self) -> str: ...
1172 # It's writable on types, but not on instances of TypeAliasType.
1173 @property
1174 def __module__(self) -> str | None: ... # type: ignore[override]
1175 def __getitem__(self, parameters: Any, /) -> GenericAlias: ... # AnnotationForm
1176 def __or__(self, right: Any, /) -> _SpecialForm: ...
1177 def __ror__(self, left: Any, /) -> _SpecialForm: ...
1178 if sys.version_info >= (3, 14):
1179 @property
1180 def evaluate_value(self) -> EvaluateFunc: ...
1181
1182 if sys.version_info >= (3, 13):
1183 def is_protocol(tp: type, /) -> bool: ...
1184 def get_protocol_members(tp: type, /) -> frozenset[str]: ...
1185 @final
1186 @type_check_only
1187 class _NoDefaultType: ...
1188
1189 NoDefault: _NoDefaultType
1190 TypeIs: _SpecialForm
1191 ReadOnly: _SpecialForm