Skip to content

Commit 5da111e

Browse files
authored
[ldap3] Use Incomplete instead of Any (#15054)
1 parent 8aa4874 commit 5da111e

40 files changed

+364
-362
lines changed

stubs/ldap3/ldap3/__init__.pyi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Literal
1+
from typing import Literal
22

33
from .abstract.attrDef import AttrDef as AttrDef
44
from .abstract.attribute import (
@@ -97,7 +97,7 @@ HASHED_SALTED_SHA384: Literal["SALTED_SHA384"]
9797
HASHED_SALTED_SHA512: Literal["SALTED_SHA512"]
9898
HASHED_SALTED_MD5: Literal["SALTED_MD5"]
9999

100-
NUMERIC_TYPES: tuple[type[Any], ...]
101-
INTEGER_TYPES: tuple[type[Any], ...]
102-
STRING_TYPES: tuple[type[Any], ...]
103-
SEQUENCE_TYPES: tuple[type[Any], ...]
100+
NUMERIC_TYPES: tuple[type, ...]
101+
INTEGER_TYPES: tuple[type, ...]
102+
STRING_TYPES: tuple[type, ...]
103+
SEQUENCE_TYPES: tuple[type, ...]

stubs/ldap3/ldap3/abstract/__init__.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any
1+
from _typeshed import Incomplete
22

33
STATUS_INIT: str
44
STATUS_VIRTUAL: str
@@ -11,5 +11,5 @@ STATUS_READY_FOR_DELETION: str
1111
STATUS_READY_FOR_MOVING: str
1212
STATUS_READY_FOR_RENAMING: str
1313
STATUS_DELETED: str
14-
STATUSES: Any
15-
INITIAL_STATUSES: Any
14+
STATUSES: Incomplete
15+
INITIAL_STATUSES: Incomplete

stubs/ldap3/ldap3/abstract/attrDef.pyi

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
from typing import Any
1+
from _typeshed import Incomplete
22

33
class AttrDef:
4-
name: Any
5-
key: Any
6-
validate: Any
7-
pre_query: Any
8-
post_query: Any
9-
default: Any
10-
dereference_dn: Any
11-
description: Any
12-
mandatory: Any
13-
single_value: Any
14-
oid_info: Any
15-
other_names: Any
4+
name: Incomplete
5+
key: Incomplete
6+
validate: Incomplete
7+
pre_query: Incomplete
8+
post_query: Incomplete
9+
default: Incomplete
10+
dereference_dn: Incomplete
11+
description: Incomplete
12+
mandatory: Incomplete
13+
single_value: Incomplete
14+
oid_info: Incomplete
15+
other_names: Incomplete
1616
def __init__(
1717
self,
1818
name,

stubs/ldap3/ldap3/abstract/attribute.pyi

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
from typing import Any
1+
from _typeshed import Incomplete
22

33
class Attribute:
4-
key: Any
5-
definition: Any
6-
values: Any
7-
raw_values: Any
8-
response: Any
9-
entry: Any
10-
cursor: Any
11-
other_names: Any
4+
key: Incomplete
5+
definition: Incomplete
6+
values: Incomplete
7+
raw_values: Incomplete
8+
response: Incomplete
9+
entry: Incomplete
10+
cursor: Incomplete
11+
other_names: Incomplete
1212
def __init__(self, attr_def, entry, cursor) -> None: ...
1313
def __len__(self) -> int: ...
1414
def __iter__(self): ...

stubs/ldap3/ldap3/abstract/cursor.pyi

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
from typing import Any, NamedTuple
1+
from _typeshed import Incomplete
2+
from typing import NamedTuple
23

34
class Operation(NamedTuple):
4-
request: Any
5-
result: Any
6-
response: Any
5+
request: Incomplete
6+
result: Incomplete
7+
response: Incomplete
78

89
class Cursor:
9-
connection: Any
10-
get_operational_attributes: Any
11-
definition: Any
12-
attributes: Any
13-
controls: Any
14-
execution_time: Any
15-
entries: Any
16-
schema: Any
10+
connection: Incomplete
11+
get_operational_attributes: Incomplete
12+
definition: Incomplete
13+
attributes: Incomplete
14+
controls: Incomplete
15+
execution_time: Incomplete
16+
entries: Incomplete
17+
schema: Incomplete
1718
def __init__(
1819
self,
1920
connection,
@@ -38,14 +39,14 @@ class Cursor:
3839
def failed(self): ...
3940

4041
class Reader(Cursor):
41-
entry_class: Any
42-
attribute_class: Any
43-
entry_initial_status: Any
44-
sub_tree: Any
45-
base: Any
46-
dereference_aliases: Any
47-
validated_query: Any
48-
query_filter: Any
42+
entry_class: Incomplete
43+
attribute_class: Incomplete
44+
entry_initial_status: Incomplete
45+
sub_tree: Incomplete
46+
base: Incomplete
47+
dereference_aliases: Incomplete
48+
validated_query: Incomplete
49+
query_filter: Incomplete
4950
def __init__(
5051
self,
5152
connection,
@@ -68,8 +69,8 @@ class Reader(Cursor):
6869
@components_in_and.setter
6970
def components_in_and(self, value) -> None: ...
7071
def clear(self) -> None: ...
71-
execution_time: Any
72-
entries: Any
72+
execution_time: Incomplete
73+
entries: Incomplete
7374
def reset(self) -> None: ...
7475
def search(self, attributes=None): ...
7576
def search_object(self, entry_dn=None, attributes=None): ...
@@ -78,14 +79,14 @@ class Reader(Cursor):
7879
def search_paged(self, paged_size, paged_criticality: bool = True, generator: bool = True, attributes=None): ...
7980

8081
class Writer(Cursor):
81-
entry_class: Any
82-
attribute_class: Any
83-
entry_initial_status: Any
82+
entry_class: Incomplete
83+
attribute_class: Incomplete
84+
entry_initial_status: Incomplete
8485
@staticmethod
8586
def from_cursor(cursor, connection=None, object_def=None, custom_validator=None): ...
8687
@staticmethod
8788
def from_response(connection, object_def, response=None): ...
88-
dereference_aliases: Any
89+
dereference_aliases: Incomplete
8990
def __init__(
9091
self,
9192
connection,
@@ -95,7 +96,7 @@ class Writer(Cursor):
9596
controls=None,
9697
auxiliary_class=None,
9798
) -> None: ...
98-
execution_time: Any
99+
execution_time: Incomplete
99100
def commit(self, refresh: bool = True): ...
100101
def discard(self) -> None: ...
101102
def new(self, dn): ...

stubs/ldap3/ldap3/abstract/entry.pyi

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
from typing import Any
1+
from _typeshed import Incomplete
22

33
class EntryState:
4-
dn: Any
5-
status: Any
6-
attributes: Any
7-
raw_attributes: Any
8-
response: Any
9-
cursor: Any
10-
origin: Any
11-
read_time: Any
12-
changes: Any
13-
definition: Any
4+
dn: Incomplete
5+
status: Incomplete
6+
attributes: Incomplete
7+
raw_attributes: Incomplete
8+
response: Incomplete
9+
cursor: Incomplete
10+
origin: Incomplete
11+
read_time: Incomplete
12+
changes: Incomplete
13+
definition: Incomplete
1414
def __init__(self, dn, cursor) -> None: ...
1515
def set_status(self, status) -> None: ...
1616
@property

stubs/ldap3/ldap3/core/exceptions.pyi

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import socket
2-
from typing import Any
2+
from _typeshed import Incomplete
33
from typing_extensions import Self
44

55
class LDAPException(Exception): ...
66

77
class LDAPOperationResult(LDAPException):
88
def __new__(cls, result=None, description=None, dn=None, message=None, response_type=None, response=None) -> Self: ...
9-
result: Any
10-
description: Any
11-
dn: Any
12-
message: Any
13-
type: Any
14-
response: Any
9+
result: Incomplete
10+
description: Incomplete
11+
dn: Incomplete
12+
message: Incomplete
13+
type: Incomplete
14+
response: Incomplete
1515
def __init__(self, result=None, description=None, dn=None, message=None, response_type=None, response=None) -> None: ...
1616

1717
class LDAPOperationsErrorResult(LDAPOperationResult): ...
@@ -63,7 +63,7 @@ class LDAPAssertionFailedResult(LDAPOperationResult): ...
6363
class LDAPAuthorizationDeniedResult(LDAPOperationResult): ...
6464
class LDAPESyncRefreshRequiredResult(LDAPOperationResult): ...
6565

66-
exception_table: Any
66+
exception_table: Incomplete
6767

6868
class LDAPExceptionError(LDAPException): ...
6969
class LDAPConfigurationError(LDAPExceptionError): ...

stubs/ldap3/ldap3/core/pooling.pyi

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
from typing import Any
1+
from _typeshed import Incomplete
22

3-
POOLING_STRATEGIES: Any
3+
POOLING_STRATEGIES: Incomplete
44

55
class ServerState:
6-
server: Any
7-
last_checked_time: Any
8-
available: Any
6+
server: Incomplete
7+
last_checked_time: Incomplete
8+
available: Incomplete
99
def __init__(self, server, last_checked_time, available) -> None: ...
1010

1111
class ServerPoolState:
12-
server_states: Any
13-
strategy: Any
14-
server_pool: Any
12+
server_states: Incomplete
13+
strategy: Incomplete
14+
server_pool: Incomplete
1515
last_used_server: int
16-
initialize_time: Any
16+
initialize_time: Incomplete
1717
def __init__(self, server_pool) -> None: ...
1818
def refresh(self) -> None: ...
1919
def get_current_server(self): ...
@@ -23,12 +23,12 @@ class ServerPoolState:
2323
def __len__(self) -> int: ...
2424

2525
class ServerPool:
26-
servers: Any
27-
pool_states: Any
28-
active: Any
29-
exhaust: Any
30-
single: Any
31-
strategy: Any
26+
servers: Incomplete
27+
pool_states: Incomplete
28+
active: Incomplete
29+
exhaust: Incomplete
30+
single: Incomplete
31+
strategy: Incomplete
3232
def __init__(
3333
self, servers=None, pool_strategy="ROUND_ROBIN", active: bool = True, exhaust: bool = False, single_state: bool = True
3434
) -> None: ...

stubs/ldap3/ldap3/core/rdns.pyi

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
from typing import Any
1+
from _typeshed import Incomplete
22

33
class ReverseDnsSetting:
4-
OFF: Any
5-
REQUIRE_RESOLVE_ALL_ADDRESSES: Any
6-
REQUIRE_RESOLVE_IP_ADDRESSES_ONLY: Any
7-
OPTIONAL_RESOLVE_ALL_ADDRESSES: Any
8-
OPTIONAL_RESOLVE_IP_ADDRESSES_ONLY: Any
9-
SUPPORTED_VALUES: Any
4+
OFF: Incomplete
5+
REQUIRE_RESOLVE_ALL_ADDRESSES: Incomplete
6+
REQUIRE_RESOLVE_IP_ADDRESSES_ONLY: Incomplete
7+
OPTIONAL_RESOLVE_ALL_ADDRESSES: Incomplete
8+
OPTIONAL_RESOLVE_IP_ADDRESSES_ONLY: Incomplete
9+
SUPPORTED_VALUES: Incomplete
1010

1111
def get_hostname_by_addr(addr, success_required: bool = True): ...
1212
def is_ip_addr(addr): ...

stubs/ldap3/ldap3/core/results.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any
1+
from _typeshed import Incomplete
22

33
RESULT_SUCCESS: int
44
RESULT_OPERATIONS_ERROR: int
@@ -52,5 +52,5 @@ RESULT_CANNOT_CANCEL: int
5252
RESULT_ASSERTION_FAILED: int
5353
RESULT_AUTHORIZATION_DENIED: int
5454
RESULT_E_SYNC_REFRESH_REQUIRED: int
55-
RESULT_CODES: Any
56-
DO_NOT_RAISE_EXCEPTIONS: Any
55+
RESULT_CODES: Incomplete
56+
DO_NOT_RAISE_EXCEPTIONS: Incomplete

0 commit comments

Comments
 (0)