Skip to content

Commit bfc83c3

Browse files
Use PEP 604 in types.pyi (#5553)
1 parent bb79dc9 commit bfc83c3

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ Accepted features that *cannot* yet be used in typeshed include:
140140
- [PEP 585](https://www.python.org/dev/peps/pep-0585/) (builtin
141141
generics): see [#4820](https://github.com/python/typeshed/issues/4820),
142142
mostly supported but bugs remain for a few specific cases
143-
- [PEP 604](https://www.python.org/dev/peps/pep-0604/) (Union
144-
pipe operator): see [#4819](https://github.com/python/typeshed/issues/4819)
145143
- [PEP 612](https://www.python.org/dev/peps/pep-0612/) (ParamSpec):
146144
see [#4827](https://github.com/python/typeshed/issues/4827)
147145
- [PEP 613](https://www.python.org/dev/peps/pep-0613/) (TypeAlias):
@@ -154,6 +152,8 @@ Supported features include:
154152
- [PEP 589](https://www.python.org/dev/peps/pep-0589/) (TypedDict)
155153
- [PEP 647](https://www.python.org/dev/peps/pep-0647/) (TypeGuard):
156154
see [#5406](https://github.com/python/typeshed/issues/5406)
155+
- [PEP 604](https://www.python.org/dev/peps/pep-0604/) (Union
156+
pipe operator): see [#4819](https://github.com/python/typeshed/issues/4819)
157157

158158
Features from the `typing` module that are not present in all
159159
supported Python 3 versions must be imported from `typing_extensions`

stdlib/types.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ class _Cell:
3434
cell_contents: Any
3535

3636
class FunctionType:
37-
__closure__: Optional[Tuple[_Cell, ...]]
37+
__closure__: Tuple[_Cell, ...] | None
3838
__code__: CodeType
39-
__defaults__: Optional[Tuple[Any, ...]]
39+
__defaults__: Tuple[Any, ...] | None
4040
__dict__: Dict[str, Any]
4141
__globals__: Dict[str, Any]
4242
__name__: str
@@ -47,12 +47,12 @@ class FunctionType:
4747
self,
4848
code: CodeType,
4949
globals: Dict[str, Any],
50-
name: Optional[str] = ...,
51-
argdefs: Optional[Tuple[object, ...]] = ...,
52-
closure: Optional[Tuple[_Cell, ...]] = ...,
50+
name: str | None = ...,
51+
argdefs: Tuple[object, ...] | None = ...,
52+
closure: Tuple[_Cell, ...] | None = ...,
5353
) -> None: ...
5454
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
55-
def __get__(self, obj: Optional[object], type: Optional[type]) -> MethodType: ...
55+
def __get__(self, obj: object | None, type: type | None) -> MethodType: ...
5656

5757
LambdaType = FunctionType
5858

0 commit comments

Comments
 (0)