From b327f64d9a72d244d41ef30b5e7ca6318c08c36f Mon Sep 17 00:00:00 2001 From: klaerik <31196946+klaerik@users.noreply.github.com> Date: Wed, 2 Feb 2022 09:59:53 -0800 Subject: [PATCH] Add iterable and ServerPool types to ldap3 Connection.server parameter (#7101) --- stubs/ldap3/ldap3/core/connection.pyi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stubs/ldap3/ldap3/core/connection.pyi b/stubs/ldap3/ldap3/core/connection.pyi index 339bdd4c5..bcea8aae5 100644 --- a/stubs/ldap3/ldap3/core/connection.pyi +++ b/stubs/ldap3/ldap3/core/connection.pyi @@ -1,13 +1,17 @@ +from _collections_abc import Generator, dict_keys from _typeshed import Self from types import TracebackType from typing import Any from typing_extensions import Literal +from .pooling import ServerPool from .server import Server SASL_AVAILABLE_MECHANISMS: Any CLIENT_STRATEGIES: Any +_ServerSequence = set[Server] | list[Server] | tuple[Server, ...] | Generator[Server, None, None] | dict_keys[Server, Any] + class Connection: connection_lock: Any last_error: str @@ -59,7 +63,7 @@ class Connection: post_send_search: Any def __init__( self, - server: Server | str, + server: Server | str | _ServerSequence | ServerPool, user: str | None = ..., password: str | None = ..., auto_bind: Literal["DEFAULT", "NONE", "NO_TLS", "TLS_BEFORE_BIND", "TLS_AFTER_BIND"] = ...,