Use _typeshed.IdentityFunction more consistently (#8063)

This commit is contained in:
Alex Waygood
2022-06-12 16:56:14 -07:00
committed by GitHub
parent 033516d39f
commit 1be5918baa
5 changed files with 11 additions and 10 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ from __future__ import print_function
import builtins
import types
import unittest
from _typeshed import IdentityFunction
from builtins import next as next
from collections.abc import Callable, ItemsView, Iterable, Iterator as _Iterator, KeysView, Mapping, ValuesView
from functools import wraps as wraps
@@ -83,7 +84,7 @@ def raise_from(value: BaseException | type[BaseException], from_value: BaseExcep
print_ = print
def with_metaclass(meta: type, *bases: type) -> type: ...
def add_metaclass(metaclass: type) -> Callable[[_T], _T]: ...
def add_metaclass(metaclass: type) -> IdentityFunction: ...
def ensure_binary(s: bytes | str, encoding: str = ..., errors: str = ...) -> bytes: ...
def ensure_str(s: bytes | str, encoding: str = ..., errors: str = ...) -> str: ...
def ensure_text(s: bytes | str, encoding: str = ..., errors: str = ...) -> str: ...