mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Mark many attributes as read-only properties (#7591)
This commit is contained in:
@@ -161,8 +161,10 @@ class Port:
|
||||
def unset_alias(self, alias: str) -> None: ...
|
||||
@property
|
||||
def uuid(self) -> str: ...
|
||||
is_audio: bool = ...
|
||||
is_midi: bool = ...
|
||||
@property
|
||||
def is_audio(self) -> bool: ...
|
||||
@property
|
||||
def is_midi(self) -> bool: ...
|
||||
@property
|
||||
def is_input(self) -> bool: ...
|
||||
@property
|
||||
|
||||
@@ -122,8 +122,10 @@ class ImageFileDirectory_v2(MutableMapping[int, Any]):
|
||||
|
||||
class ImageFileDirectory_v1(ImageFileDirectory_v2):
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
tags: Any
|
||||
tagdata: Any
|
||||
@property
|
||||
def tags(self): ...
|
||||
@property
|
||||
def tagdata(self): ...
|
||||
tagtype: dict[int, int]
|
||||
@classmethod
|
||||
def from_v2(cls, original): ...
|
||||
|
||||
@@ -14,8 +14,10 @@ KEY_OBJECTS_BUT_WARN: int
|
||||
KEY_OBJECTS_NO_WARN: int
|
||||
|
||||
class Row(BaseRow, Sequence[Any], metaclass=abc.ABCMeta):
|
||||
count: Any
|
||||
index: Any
|
||||
@property
|
||||
def count(self): ...
|
||||
@property
|
||||
def index(self): ...
|
||||
def __contains__(self, key): ...
|
||||
__hash__: Any
|
||||
def __lt__(self, other): ...
|
||||
|
||||
@@ -93,7 +93,8 @@ class _AssociationCollection:
|
||||
setter: Any
|
||||
parent: Any
|
||||
def __init__(self, lazy_collection, creator, getter, setter, parent) -> None: ...
|
||||
col: Any
|
||||
@property
|
||||
def col(self): ...
|
||||
def __len__(self): ...
|
||||
def __bool__(self): ...
|
||||
__nonzero__: Any
|
||||
|
||||
@@ -92,7 +92,8 @@ class ForeignKey(DialectKWArgs, SchemaItem):
|
||||
**dialect_kw,
|
||||
) -> None: ...
|
||||
def copy(self, schema: Any | None = ..., **kw): ...
|
||||
target_fullname: Any
|
||||
@property
|
||||
def target_fullname(self): ...
|
||||
def references(self, table): ...
|
||||
def get_referent(self, table): ...
|
||||
@memoized_property
|
||||
|
||||
@@ -70,7 +70,8 @@ class FromClause(roles.AnonymizedFromClauseRole, Selectable):
|
||||
def primary_key(self): ...
|
||||
@memoized_property
|
||||
def foreign_keys(self): ...
|
||||
c: Any
|
||||
@property
|
||||
def c(self): ...
|
||||
|
||||
LABEL_STYLE_NONE: Any
|
||||
LABEL_STYLE_TABLENAME_PLUS_COL: Any
|
||||
@@ -383,7 +384,8 @@ class ScalarSelect(roles.InElementRole, Generative, Grouping):
|
||||
def __init__(self, element) -> None: ...
|
||||
@property
|
||||
def columns(self) -> None: ...
|
||||
c: Any
|
||||
@property
|
||||
def c(self): ...
|
||||
def where(self, crit) -> None: ...
|
||||
def self_group(self, **kwargs): ...
|
||||
def correlate(self, *fromclauses) -> None: ...
|
||||
|
||||
@@ -21,13 +21,17 @@ class Locale:
|
||||
def __ne__(self, other): ...
|
||||
def __hash__(self): ...
|
||||
def get_display_name(self, locale: Any | None = ...): ...
|
||||
display_name: Any
|
||||
@property
|
||||
def display_name(self): ...
|
||||
def get_language_name(self, locale: Any | None = ...): ...
|
||||
language_name: Any
|
||||
@property
|
||||
def language_name(self): ...
|
||||
def get_territory_name(self, locale: Any | None = ...): ...
|
||||
territory_name: Any
|
||||
@property
|
||||
def territory_name(self): ...
|
||||
def get_script_name(self, locale: Any | None = ...): ...
|
||||
script_name: Any
|
||||
@property
|
||||
def script_name(self): ...
|
||||
@property
|
||||
def english_name(self): ...
|
||||
@property
|
||||
|
||||
@@ -70,7 +70,8 @@ class Catalog:
|
||||
charset: Any | None = ...,
|
||||
fuzzy: bool = ...,
|
||||
) -> None: ...
|
||||
locale_identifier: Any
|
||||
@property
|
||||
def locale_identifier(self): ...
|
||||
header_comment: Any
|
||||
mime_headers: Any
|
||||
@property
|
||||
|
||||
@@ -5,8 +5,11 @@ PLURALS: Any
|
||||
DEFAULT_PLURAL: Any
|
||||
|
||||
class _PluralTuple(tuple[int, str]):
|
||||
num_plurals: Any
|
||||
plural_expr: Any
|
||||
plural_forms: Any
|
||||
@property
|
||||
def num_plurals(self) -> int: ...
|
||||
@property
|
||||
def plural_expr(self) -> str: ...
|
||||
@property
|
||||
def plural_forms(self) -> str: ...
|
||||
|
||||
def get_plural(locale=...): ...
|
||||
|
||||
@@ -9,7 +9,8 @@ class PluralRule:
|
||||
def parse(cls, rules): ...
|
||||
@property
|
||||
def rules(self): ...
|
||||
tags: Any
|
||||
@property
|
||||
def tags(self): ...
|
||||
def __call__(self, n): ...
|
||||
|
||||
def to_javascript(rule): ...
|
||||
|
||||
@@ -58,7 +58,8 @@ class Element(Any): # html5lib.treebuilders.base.Node
|
||||
def cloneNode(self): ...
|
||||
def hasContent(self): ...
|
||||
def getNameTuple(self): ...
|
||||
nameTuple: Any
|
||||
@property
|
||||
def nameTuple(self): ...
|
||||
|
||||
class TextNode(Element):
|
||||
element: Any
|
||||
|
||||
@@ -262,7 +262,8 @@ class Tag(PageElement):
|
||||
def __copy__(self: Self) -> Self: ...
|
||||
@property
|
||||
def is_empty_element(self) -> bool: ...
|
||||
isSelfClosing = is_empty_element
|
||||
@property
|
||||
def isSelfClosing(self) -> bool: ...
|
||||
@property
|
||||
def string(self) -> str | None: ...
|
||||
@string.setter
|
||||
|
||||
@@ -91,12 +91,14 @@ class AWSAuthConnection:
|
||||
def aws_access_key_id(self): ...
|
||||
@property
|
||||
def gs_access_key_id(self) -> Any: ...
|
||||
access_key: Any
|
||||
@property
|
||||
def access_key(self): ...
|
||||
@property
|
||||
def aws_secret_access_key(self): ...
|
||||
@property
|
||||
def gs_secret_access_key(self): ...
|
||||
secret_key: Any
|
||||
@property
|
||||
def secret_key(self): ...
|
||||
@property
|
||||
def profile_name(self): ...
|
||||
def get_path(self, path: str = ...): ...
|
||||
|
||||
@@ -30,7 +30,8 @@ class DHParameterNumbers:
|
||||
def parameters(self, backend: DHBackend | None = ...) -> DHParameters: ...
|
||||
|
||||
class DHPrivateKey(metaclass=ABCMeta):
|
||||
key_size: int
|
||||
@property
|
||||
def key_size(self) -> int: ...
|
||||
@abstractmethod
|
||||
def exchange(self, peer_public_key: DHPublicKey) -> bytes: ...
|
||||
@abstractmethod
|
||||
|
||||
@@ -7,4 +7,5 @@ class Prehashed:
|
||||
_algorithm: HashAlgorithm # undocumented
|
||||
_digest_size: int # undocumented
|
||||
def __init__(self, algorithm: HashAlgorithm) -> None: ...
|
||||
digest_size: int
|
||||
@property
|
||||
def digest_size(self) -> int: ...
|
||||
|
||||
@@ -2,12 +2,17 @@ from abc import ABCMeta, abstractmethod
|
||||
|
||||
from cryptography.hazmat.backends.interfaces import HashBackend
|
||||
|
||||
# These are actually abstractproperties on HashAlgorithm,
|
||||
# but let's not worry too much about that.
|
||||
class HashAlgorithm(metaclass=ABCMeta):
|
||||
digest_size: int
|
||||
name: str
|
||||
@property
|
||||
def digest_size(self) -> int: ...
|
||||
@property
|
||||
def name(self) -> str: ...
|
||||
|
||||
class HashContext(metaclass=ABCMeta):
|
||||
algorithm: HashAlgorithm
|
||||
@property
|
||||
def algorithm(self) -> HashAlgorithm: ...
|
||||
@abstractmethod
|
||||
def copy(self) -> HashContext: ...
|
||||
@abstractmethod
|
||||
|
||||
@@ -15,7 +15,8 @@ from cryptography.hazmat.primitives.hashes import HashAlgorithm
|
||||
from cryptography.hazmat.primitives.serialization import Encoding
|
||||
|
||||
class ObjectIdentifier:
|
||||
dotted_string: str
|
||||
@property
|
||||
def dotted_string(self) -> str: ...
|
||||
def __init__(self, dotted_string: str) -> None: ...
|
||||
|
||||
class CRLEntryExtensionOID:
|
||||
@@ -108,7 +109,8 @@ class ExtendedKeyUsageOID:
|
||||
|
||||
class NameAttribute:
|
||||
oid: ObjectIdentifier
|
||||
value: str
|
||||
@property
|
||||
def value(self) -> str: ...
|
||||
def __init__(self, oid: ObjectIdentifier, value: str) -> None: ...
|
||||
def rfc4514_string(self) -> str: ...
|
||||
|
||||
@@ -119,7 +121,8 @@ class RelativeDistinguishedName:
|
||||
def rfc4514_string(self) -> str: ...
|
||||
|
||||
class Name:
|
||||
rdns: list[RelativeDistinguishedName]
|
||||
@property
|
||||
def rdns(self) -> list[RelativeDistinguishedName]: ...
|
||||
def __init__(self, attributes: Sequence[NameAttribute | RelativeDistinguishedName]) -> None: ...
|
||||
def __iter__(self) -> Generator[NameAttribute, None, None]: ...
|
||||
def __len__(self) -> int: ...
|
||||
@@ -131,18 +134,31 @@ class Version(Enum):
|
||||
v1: int
|
||||
v3: int
|
||||
|
||||
# These are actually abstractproperties on Certificate,
|
||||
# but let's not worry too much about that
|
||||
class Certificate(metaclass=ABCMeta):
|
||||
extensions: Extensions
|
||||
issuer: Name
|
||||
not_valid_after: datetime.datetime
|
||||
not_valid_before: datetime.datetime
|
||||
serial_number: int
|
||||
signature: bytes
|
||||
signature_algorithm_oid: ObjectIdentifier
|
||||
signature_hash_algorithm: HashAlgorithm
|
||||
tbs_certificate_bytes: bytes
|
||||
subject: Name
|
||||
version: Version
|
||||
@property
|
||||
def extensions(self) -> Extensions: ...
|
||||
@property
|
||||
def issuer(self) -> Name: ...
|
||||
@property
|
||||
def not_valid_after(self) -> datetime.datetime: ...
|
||||
@property
|
||||
def not_valid_before(self) -> datetime.datetime: ...
|
||||
@property
|
||||
def serial_number(self) -> int: ...
|
||||
@property
|
||||
def signature(self) -> bytes: ...
|
||||
@property
|
||||
def signature_algorithm_oid(self) -> ObjectIdentifier: ...
|
||||
@property
|
||||
def signature_hash_algorithm(self) -> HashAlgorithm: ...
|
||||
@property
|
||||
def tbs_certificate_bytes(self) -> bytes: ...
|
||||
@property
|
||||
def subject(self) -> Name: ...
|
||||
@property
|
||||
def version(self) -> Version: ...
|
||||
@abstractmethod
|
||||
def fingerprint(self, algorithm: HashAlgorithm) -> bytes: ...
|
||||
@abstractmethod
|
||||
@@ -178,14 +194,22 @@ class CertificateBuilder:
|
||||
def subject_name(self, name: Name) -> CertificateBuilder: ...
|
||||
|
||||
class CertificateRevocationList(metaclass=ABCMeta):
|
||||
extensions: Extensions
|
||||
issuer: Name
|
||||
last_update: datetime.datetime
|
||||
next_update: datetime.datetime
|
||||
signature: bytes
|
||||
signature_algorithm_oid: ObjectIdentifier
|
||||
signature_hash_algorithm: HashAlgorithm
|
||||
tbs_certlist_bytes: bytes
|
||||
@property
|
||||
def extensions(self) -> Extensions: ...
|
||||
@property
|
||||
def issuer(self) -> Name: ...
|
||||
@property
|
||||
def last_update(self) -> datetime.datetime: ...
|
||||
@property
|
||||
def next_update(self) -> datetime.datetime: ...
|
||||
@property
|
||||
def signature(self) -> bytes: ...
|
||||
@property
|
||||
def signature_algorithm_oid(self) -> ObjectIdentifier: ...
|
||||
@property
|
||||
def signature_hash_algorithm(self) -> HashAlgorithm: ...
|
||||
@property
|
||||
def tbs_certlist_bytes(self) -> bytes: ...
|
||||
@abstractmethod
|
||||
def fingerprint(self, algorithm: HashAlgorithm) -> bytes: ...
|
||||
@abstractmethod
|
||||
@@ -211,13 +235,20 @@ class CertificateRevocationListBuilder:
|
||||
) -> CertificateRevocationList: ...
|
||||
|
||||
class CertificateSigningRequest(metaclass=ABCMeta):
|
||||
extensions: Extensions
|
||||
is_signature_valid: bool
|
||||
signature: bytes
|
||||
signature_algorithm_oid: ObjectIdentifier
|
||||
signature_hash_algorithm: HashAlgorithm
|
||||
subject: Name
|
||||
tbs_certrequest_bytes: bytes
|
||||
@property
|
||||
def extensions(self) -> Extensions: ...
|
||||
@property
|
||||
def is_signature_valid(self) -> bool: ...
|
||||
@property
|
||||
def signature(self) -> bytes: ...
|
||||
@property
|
||||
def signature_algorithm_oid(self) -> ObjectIdentifier: ...
|
||||
@property
|
||||
def signature_hash_algorithm(self) -> HashAlgorithm: ...
|
||||
@property
|
||||
def subject(self) -> Name: ...
|
||||
@property
|
||||
def tbs_certrequest_bytes(self) -> bytes: ...
|
||||
@abstractmethod
|
||||
def public_bytes(self, encoding: Encoding) -> bytes: ...
|
||||
@abstractmethod
|
||||
@@ -234,9 +265,12 @@ class CertificateSigningRequestBuilder:
|
||||
) -> CertificateSigningRequest: ...
|
||||
|
||||
class RevokedCertificate(metaclass=ABCMeta):
|
||||
extensions: Extensions
|
||||
revocation_date: datetime.datetime
|
||||
serial_number: int
|
||||
@property
|
||||
def extensions(self) -> Extensions: ...
|
||||
@property
|
||||
def revocation_date(self) -> datetime.datetime: ...
|
||||
@property
|
||||
def serial_number(self) -> int: ...
|
||||
|
||||
class RevokedCertificateBuilder:
|
||||
def add_extension(self, extension: ExtensionType, critical: bool) -> RevokedCertificateBuilder: ...
|
||||
@@ -247,35 +281,44 @@ class RevokedCertificateBuilder:
|
||||
# General Name Classes
|
||||
|
||||
class GeneralName(metaclass=ABCMeta):
|
||||
value: Any
|
||||
@property
|
||||
def value(self): ...
|
||||
|
||||
class DirectoryName(GeneralName):
|
||||
value: Name
|
||||
@property
|
||||
def value(self) -> Name: ...
|
||||
def __init__(self, value: Name) -> None: ...
|
||||
|
||||
class DNSName(GeneralName):
|
||||
value: str
|
||||
@property
|
||||
def value(self) -> str: ...
|
||||
def __init__(self, value: str) -> None: ...
|
||||
|
||||
class IPAddress(GeneralName):
|
||||
value: IPv4Address | IPv6Address | IPv4Network | IPv6Network
|
||||
@property
|
||||
def value(self) -> IPv4Address | IPv6Address | IPv4Network | IPv6Network: ...
|
||||
def __init__(self, value: IPv4Address | IPv6Address | IPv4Network | IPv6Network) -> None: ...
|
||||
|
||||
class OtherName(GeneralName):
|
||||
type_id: ObjectIdentifier
|
||||
value: bytes
|
||||
@property
|
||||
def type_id(self) -> ObjectIdentifier: ...
|
||||
@property
|
||||
def value(self) -> bytes: ...
|
||||
def __init__(self, type_id: ObjectIdentifier, value: bytes) -> None: ...
|
||||
|
||||
class RegisteredID(GeneralName):
|
||||
value: ObjectIdentifier
|
||||
@property
|
||||
def value(self) -> ObjectIdentifier: ...
|
||||
def __init__(self, value: ObjectIdentifier) -> None: ...
|
||||
|
||||
class RFC822Name(GeneralName):
|
||||
value: str
|
||||
@property
|
||||
def value(self) -> str: ...
|
||||
def __init__(self, value: str) -> None: ...
|
||||
|
||||
class UniformResourceIdentifier(GeneralName):
|
||||
value: str
|
||||
@property
|
||||
def value(self) -> str: ...
|
||||
def __init__(self, value: str) -> None: ...
|
||||
|
||||
# X.509 Extensions
|
||||
@@ -286,9 +329,11 @@ class ExtensionType(metaclass=ABCMeta):
|
||||
_T = TypeVar("_T", bound=ExtensionType)
|
||||
|
||||
class Extension(Generic[_T]):
|
||||
critical: bool
|
||||
@property
|
||||
def critical(self) -> bool: ...
|
||||
oid: ObjectIdentifier
|
||||
value: _T
|
||||
@property
|
||||
def value(self) -> _T: ...
|
||||
|
||||
class Extensions:
|
||||
def __init__(self, general_names: list[Extension[Any]]) -> None: ...
|
||||
|
||||
@@ -1,22 +1,26 @@
|
||||
from typing import Any, Iterator
|
||||
from collections.abc import Iterator
|
||||
|
||||
from cryptography.x509 import GeneralName, ObjectIdentifier
|
||||
|
||||
class Extension:
|
||||
value: Any = ...
|
||||
@property
|
||||
def value(self): ...
|
||||
|
||||
class GeneralNames:
|
||||
def __iter__(self) -> Iterator[GeneralName]: ...
|
||||
|
||||
class DistributionPoint:
|
||||
full_name: GeneralNames = ...
|
||||
@property
|
||||
def full_name(self) -> GeneralNames: ...
|
||||
|
||||
class CRLDistributionPoints:
|
||||
def __iter__(self) -> Iterator[DistributionPoint]: ...
|
||||
|
||||
class AccessDescription:
|
||||
access_method: ObjectIdentifier = ...
|
||||
access_location: GeneralName = ...
|
||||
@property
|
||||
def access_method(self) -> ObjectIdentifier: ...
|
||||
@property
|
||||
def access_location(self) -> GeneralName: ...
|
||||
|
||||
class AuthorityInformationAccess:
|
||||
def __iter__(self) -> Iterator[AccessDescription]: ...
|
||||
|
||||
@@ -82,7 +82,8 @@ class EncodingBytes(bytes):
|
||||
def getPosition(self): ...
|
||||
position: Any
|
||||
def getCurrentByte(self): ...
|
||||
currentByte: Any
|
||||
@property
|
||||
def currentByte(self): ...
|
||||
def skip(self, chars=...): ...
|
||||
def skipUntil(self, chars): ...
|
||||
def matchBytes(self, bytes): ...
|
||||
|
||||
@@ -15,7 +15,8 @@ class DocumentType:
|
||||
class Document:
|
||||
def __init__(self) -> None: ...
|
||||
def appendChild(self, element) -> None: ...
|
||||
childNodes: Any
|
||||
@property
|
||||
def childNodes(self): ...
|
||||
|
||||
def testSerializer(element): ...
|
||||
def tostring(element): ...
|
||||
|
||||
@@ -66,7 +66,8 @@ class MergedCell(StyleableObject):
|
||||
row: Any
|
||||
column: Any
|
||||
def __init__(self, worksheet, row: Any | None = ..., column: Any | None = ...) -> None: ...
|
||||
coordinate: Any
|
||||
@property
|
||||
def coordinate(self): ...
|
||||
value: Any
|
||||
|
||||
def WriteOnlyCell(ws: Any | None = ..., value: Any | None = ...): ...
|
||||
|
||||
@@ -5,8 +5,10 @@ def read_dimension(source): ...
|
||||
class ReadOnlyWorksheet:
|
||||
cell: Any
|
||||
iter_rows: Any
|
||||
values: Any
|
||||
rows: Any
|
||||
@property
|
||||
def values(self): ...
|
||||
@property
|
||||
def rows(self): ...
|
||||
__getitem__: Any
|
||||
__iter__: Any
|
||||
parent: Any
|
||||
|
||||
@@ -7,13 +7,16 @@ class WriteOnlyWorksheet(_WorkbookChild):
|
||||
add_chart: Any
|
||||
add_image: Any
|
||||
add_table: Any
|
||||
tables: Any
|
||||
print_titles: Any
|
||||
@property
|
||||
def tables(self): ...
|
||||
@property
|
||||
def print_titles(self): ...
|
||||
print_title_cols: Any
|
||||
print_title_rows: Any
|
||||
freeze_panes: Any
|
||||
print_area: Any
|
||||
sheet_view: Any
|
||||
@property
|
||||
def sheet_view(self): ...
|
||||
def __init__(self, parent, title) -> None: ...
|
||||
@property
|
||||
def closed(self): ...
|
||||
|
||||
@@ -6,7 +6,8 @@ from .cell_range import CellRange
|
||||
|
||||
class MergeCell(CellRange):
|
||||
tagname: str
|
||||
ref: Any
|
||||
@property
|
||||
def ref(self): ...
|
||||
__attrs__: Any
|
||||
def __init__(self, ref: Any | None = ...) -> None: ...
|
||||
def __copy__(self): ...
|
||||
|
||||
@@ -32,7 +32,9 @@ PageBreak = RowBreak
|
||||
|
||||
class ColBreak(RowBreak):
|
||||
tagname: str
|
||||
count: Any
|
||||
manualBreakCount: Any
|
||||
@property
|
||||
def count(self): ...
|
||||
@property
|
||||
def manualBreakCount(self): ...
|
||||
brk: Any
|
||||
__attrs__: Any
|
||||
|
||||
@@ -152,7 +152,8 @@ class PrefixWrapper:
|
||||
def __init__(
|
||||
self, name, wrapped, prefix=..., orig_prefix=..., lazy: bool = ..., doc: Any | None = ..., ident: Any | None = ...
|
||||
) -> None: ...
|
||||
wrapped: Any
|
||||
@property
|
||||
def wrapped(self): ...
|
||||
@property
|
||||
def ident(self): ...
|
||||
@property
|
||||
|
||||
@@ -121,10 +121,14 @@ class Distribution(IResourceProvider, IMetadataProvider):
|
||||
PKG_INFO: str
|
||||
location: str
|
||||
project_name: str
|
||||
key: str
|
||||
extras: list[str]
|
||||
version: str
|
||||
parsed_version: tuple[str, ...]
|
||||
@property
|
||||
def key(self) -> str: ...
|
||||
@property
|
||||
def extras(self) -> list[str]: ...
|
||||
@property
|
||||
def version(self) -> str: ...
|
||||
@property
|
||||
def parsed_version(self) -> tuple[str, ...]: ...
|
||||
py_version: str
|
||||
platform: str | None
|
||||
precedence: int
|
||||
|
||||
@@ -13,7 +13,8 @@ class InfoCommon:
|
||||
def name(self): ...
|
||||
def tagged_version(self): ...
|
||||
def tags(self): ...
|
||||
vtags: Any
|
||||
@property
|
||||
def vtags(self): ...
|
||||
|
||||
class egg_info(InfoCommon, Command):
|
||||
description: str
|
||||
|
||||
Reference in New Issue
Block a user