mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
remove quoted strings (#6933)
This commit is contained in:
@@ -64,8 +64,6 @@ LambdaType = FunctionType
|
||||
|
||||
@final
|
||||
class CodeType:
|
||||
"""Create a code object. Not for the faint of heart."""
|
||||
|
||||
co_argcount: int
|
||||
if sys.version_info >= (3, 8):
|
||||
co_posonlyargcount: int
|
||||
@@ -262,19 +260,15 @@ class CoroutineType(Coroutine[_T_co, _T_contra, _V_co]):
|
||||
def throw(self, __typ: BaseException, __val: None = ..., __tb: TracebackType | None = ...) -> _T_co: ...
|
||||
|
||||
class _StaticFunctionType:
|
||||
"""Fictional type to correct the type of MethodType.__func__.
|
||||
|
||||
FunctionType is a descriptor, so mypy follows the descriptor protocol and
|
||||
converts MethodType.__func__ back to MethodType (the return type of
|
||||
FunctionType.__get__). But this is actually a special case; MethodType is
|
||||
implemented in C and its attribute access doesn't go through
|
||||
__getattribute__.
|
||||
|
||||
By wrapping FunctionType in _StaticFunctionType, we get the right result;
|
||||
similar to wrapping a function in staticmethod() at runtime to prevent it
|
||||
being bound as a method.
|
||||
"""
|
||||
|
||||
# Fictional type to correct the type of MethodType.__func__.
|
||||
# FunctionType is a descriptor, so mypy follows the descriptor protocol and
|
||||
# converts MethodType.__func__ back to MethodType (the return type of
|
||||
# FunctionType.__get__). But this is actually a special case; MethodType is
|
||||
# implemented in C and its attribute access doesn't go through
|
||||
# __getattribute__.
|
||||
# By wrapping FunctionType in _StaticFunctionType, we get the right result;
|
||||
# similar to wrapping a function in staticmethod() at runtime to prevent it
|
||||
# being bound as a method.
|
||||
def __get__(self, obj: object | None, type: type | None) -> FunctionType: ...
|
||||
|
||||
@final
|
||||
|
||||
Reference in New Issue
Block a user