Use ConvertibleToInt/ConvertibleToFloat in many third-party stubs (#11022)

Note: this may make the latest version of certain stubs packages incompatible with older versions of mypy and pyright.
This commit is contained in:
Avasam
2023-11-29 06:23:00 -05:00
committed by GitHub
parent 09668963a1
commit 4687faab8e
80 changed files with 831 additions and 970 deletions

View File

@@ -1,7 +1,6 @@
from _typeshed import Incomplete, ReadableBuffer, SupportsRichComparison, SupportsTrunc
from _typeshed import ConvertibleToInt, Incomplete, SupportsRichComparison
from collections.abc import Callable, Generator
from typing import SupportsInt
from typing_extensions import Self, SupportsIndex, TypeAlias
from typing_extensions import Self
from pyasn1.type import base, constraint, namedtype, namedval
from pyasn1.type.tag import TagSet
@@ -26,7 +25,6 @@ __all__ = [
"NoValue",
"noValue",
]
_SizedIntegerable: TypeAlias = ReadableBuffer | str | SupportsInt | SupportsIndex | SupportsTrunc
NoValue = base.NoValue
noValue: NoValue
@@ -129,11 +127,11 @@ class BitString(base.SimpleAsn1Type):
def asInteger(self): ...
def asBinary(self): ...
@classmethod
def fromHexString(cls, value, internalFormat: bool = False, prepend: _SizedIntegerable | None = None): ...
def fromHexString(cls, value, internalFormat: bool = False, prepend: ConvertibleToInt | None = None): ...
@classmethod
def fromBinaryString(cls, value, internalFormat: bool = False, prepend: _SizedIntegerable | None = None): ...
def fromBinaryString(cls, value, internalFormat: bool = False, prepend: ConvertibleToInt | None = None): ...
@classmethod
def fromOctetString(cls, value, internalFormat: bool = False, prepend: _SizedIntegerable | None = None, padding: int = 0): ...
def fromOctetString(cls, value, internalFormat: bool = False, prepend: ConvertibleToInt | None = None, padding: int = 0): ...
def prettyIn(self, value): ...
class OctetString(base.SimpleAsn1Type):