@@ -96,19 +96,18 @@ async def send_udp(
9696) -> tuple [int , float ]:
9797 """Send a DNS message to the specified UDP socket.
9898
99- *sock*, a ``dns.asyncbackend.DatagramSocket``.
100-
101- *what*, a ``bytes`` or ``dns.message.Message``, the message to send.
102-
103- *destination*, a destination tuple appropriate for the address family
104- of the socket, specifying where to send the query.
105-
106- *expiration*, a ``float`` or ``None``, the absolute time at which
107- a timeout exception should be raised. If ``None``, no timeout will
108- occur. The expiration value is meaningless for the asyncio backend, as
109- asyncio's transport sendto() never blocks.
110-
111- Returns an ``(int, float)`` tuple of bytes sent and the sent time.
99+ :param sock: The socket to use.
100+ :type sock: :py:class:`dns.asyncbackend.DatagramSocket`
101+ :param what: The message to send.
102+ :type what: bytes or :py:class:`dns.message.Message`
103+ :param destination: A destination tuple appropriate for the address
104+ family of the socket.
105+ :param expiration: The absolute time at which to raise a timeout
106+ exception. ``None`` means no timeout (and is meaningless for the
107+ asyncio backend, as ``sendto()`` never blocks there).
108+ :type expiration: float or ``None``
109+ :returns: A ``(bytes_sent, sent_time)`` tuple.
110+ :rtype: tuple[int, float]
112111 """
113112
114113 if isinstance (what , dns .message .Message ):
@@ -133,13 +132,14 @@ async def receive_udp(
133132) -> Any :
134133 """Read a DNS message from a UDP socket.
135134
136- *sock*, a ``dns.asyncbackend.DatagramSocket``.
135+ :param sock: The socket to read from.
136+ :type sock: :py:class:`dns.asyncbackend.DatagramSocket`
137137
138- See :py:func:`dns.query.receive_udp() ` for the documentation of the other
139- parameters, and exceptions.
138+ See :py:func:`dns.query.receive_udp` for the documentation of the other
139+ parameters and exceptions.
140140
141- Returns a ``(dns. message.Message, float, tuple )`` tuple of the received message, the
142- received time, and the address where the message arrived from.
141+ :returns: A ``(message, received_time, from_address )`` tuple.
142+ :rtype: tuple
143143 """
144144
145145 wire = b""
@@ -197,13 +197,13 @@ async def udp(
197197) -> dns .message .Message :
198198 """Return the response obtained after sending a query via UDP.
199199
200- * sock*, a ``dns.asyncbackend.DatagramSocket``, or ``None``,
201- the socket to use for the query. If ``None``, the default, a
202- socket is created. Note that if a socket is provided, the
203- *source*, *source_port*, and *backend* are ignored.
204-
205- *backend*, a ``dns.asyncbackend.Backend``, or ``None``. If ``None``,
206- the default, then dnspython will use the default backend.
200+ :param sock: The socket to use. If ``None`` (the default), a socket is
201+ created. Note that if a socket is provided, *source*, *source_port*,
202+ and *backend* are ignored.
203+ :type sock: :py:class:`dns.asyncbackend.DatagramSocket` or ``None``
204+ :param backend: The async backend. If ``None`` (the default), dnspython
205+ will use the default backend.
206+ :type backend: :py:class:`dns.asyncbackend.Backend` or ``None``
207207
208208 See :py:func:`dns.query.udp()` for the documentation of the other
209209 parameters, exceptions, and return type of this method.
@@ -264,18 +264,18 @@ async def udp_with_fallback(
264264 """Return the response to the query, trying UDP first and falling back
265265 to TCP if UDP results in a truncated response.
266266
267- * udp_sock*, a ``dns.asyncbackend.DatagramSocket``, or ``None``,
268- the socket to use for the UDP query. If ``None``, the default, a
269- socket is created. Note that if a socket is provided the *source*,
270- *source_port*, and *backend* are ignored for the UDP query.
271-
272- *tcp_sock* , a ``dns.asyncbackend.StreamSocket``, or ``None``, the
273- socket to use for the TCP query. If ``None``, the default, a
274- socket is created. Note that if a socket is provided *where*,
275- *source*, *source_port*, and *backend* are ignored for the TCP query.
276-
277- *backend*, a ``dns.asyncbackend.Backend``, or ``None``. If ``None``,
278- the default, then dnspython will use the default backend.
267+ :param udp_sock: The socket to use for the UDP query. If ``None``
268+ ( the default), a socket is created. Note that if a socket is provided,
269+ *source*, *source_port*, and *backend* are ignored for the UDP query.
270+ :type udp_sock: :py:class:`dns.asyncbackend.DatagramSocket` or ``None``
271+ :param tcp_sock: The socket to use for the TCP query. If ``None``
272+ (the default) , a socket is created. Note that if a socket is provided,
273+ *where*, *source*, *source_port*, and *backend* are ignored for the
274+ TCP query.
275+ :type tcp_sock: :py:class:`dns.asyncbackend.StreamSocket` or ``None``
276+ :param backend: The async backend. If ``None`` (the default), dnspython
277+ will use the default backend.
278+ :type backend: :py:class:`dns.asyncbackend.Backend` or ``None``
279279
280280 See :py:func:`dns.query.udp_with_fallback()` for the documentation
281281 of the other parameters, exceptions, and return type of this
@@ -321,7 +321,8 @@ async def send_tcp(
321321) -> tuple [int , float ]:
322322 """Send a DNS message to the specified TCP socket.
323323
324- *sock*, a ``dns.asyncbackend.StreamSocket``.
324+ :param sock: The socket to use.
325+ :type sock: :py:class:`dns.asyncbackend.StreamSocket`
325326
326327 See :py:func:`dns.query.send_tcp()` for the documentation of the other
327328 parameters, exceptions, and return type of this method.
@@ -364,7 +365,8 @@ async def receive_tcp(
364365) -> tuple [dns .message .Message , float ]:
365366 """Read a DNS message from a TCP socket.
366367
367- *sock*, a ``dns.asyncbackend.StreamSocket``.
368+ :param sock: The socket to use.
369+ :type sock: :py:class:`dns.asyncbackend.StreamSocket`
368370
369371 See :py:func:`dns.query.receive_tcp()` for the documentation of the other
370372 parameters, exceptions, and return type of this method.
@@ -399,13 +401,13 @@ async def tcp(
399401) -> dns .message .Message :
400402 """Return the response obtained after sending a query via TCP.
401403
402- * sock*, a ``dns.asyncbacket.StreamSocket``, or ``None``, the
403- socket to use for the query. If ``None``, the default, a socket
404- is created. Note that if a socket is provided
405- *where*, *port*, *source*, *source_port*, and *backend* are ignored.
406-
407- *backend*, a ``dns.asyncbackend.Backend``, or ``None``. If ``None``,
408- the default, then dnspython will use the default backend.
404+ :param sock: The socket to use. If ``None`` ( the default), a socket is
405+ created. Note that if a socket is provided, *where*, *port*,
406+ *source*, *source_port*, and *backend* are ignored.
407+ :type sock: :py:class:`dns.asyncbackend.StreamSocket` or ``None``
408+ :param backend: The async backend. If ``None`` (the default), dnspython
409+ will use the default backend.
410+ :type backend: :py:class:`dns.asyncbackend.Backend` or ``None``
409411
410412 See :py:func:`dns.query.tcp()` for the documentation of the other
411413 parameters, exceptions, and return type of this method.
@@ -463,15 +465,14 @@ async def tls(
463465) -> dns .message .Message :
464466 """Return the response obtained after sending a query via TLS.
465467
466- *sock*, an ``asyncbackend.StreamSocket``, or ``None``, the socket
467- to use for the query. If ``None``, the default, a socket is
468- created. Note that if a socket is provided, it must be a
469- connected SSL stream socket, and *where*, *port*,
470- *source*, *source_port*, *backend*, *ssl_context*, and *server_hostname*
471- are ignored.
472-
473- *backend*, a ``dns.asyncbackend.Backend``, or ``None``. If ``None``,
474- the default, then dnspython will use the default backend.
468+ :param sock: The socket to use. If ``None`` (the default), a socket is
469+ created. Note that if a socket is provided, it must be a connected
470+ SSL stream socket, and *where*, *port*, *source*, *source_port*,
471+ *backend*, *ssl_context*, and *server_hostname* are ignored.
472+ :type sock: :py:class:`dns.asyncbackend.StreamSocket` or ``None``
473+ :param backend: The async backend. If ``None`` (the default), dnspython
474+ will use the default backend.
475+ :type backend: :py:class:`dns.asyncbackend.Backend` or ``None``
475476
476477 See :py:func:`dns.query.tls()` for the documentation of the other
477478 parameters, exceptions, and return type of this method.
@@ -550,11 +551,10 @@ async def https(
550551) -> dns .message .Message :
551552 """Return the response obtained after sending a query via DNS-over-HTTPS.
552553
553- *client*, a ``httpx.AsyncClient``. If provided, the client to use for
554- the query.
555-
556- Unlike the other dnspython async functions, a backend cannot be provided
557- in this function because httpx always auto-detects the async backend.
554+ :param client: If provided, the client to use for the query. Unlike the
555+ other dnspython async functions, a backend cannot be provided here
556+ because httpx always auto-detects the async backend.
557+ :type client: ``httpx.AsyncClient`` or ``None``
558558
559559 See :py:func:`dns.query.https()` for the documentation of the other
560560 parameters, exceptions, and return type of this method.
@@ -788,8 +788,9 @@ async def quic(
788788 """Return the response obtained after sending an asynchronous query via
789789 DNS-over-QUIC.
790790
791- *backend*, a ``dns.asyncbackend.Backend``, or ``None``. If ``None``,
792- the default, then dnspython will use the default backend.
791+ :param backend: The async backend. If ``None`` (the default), dnspython
792+ will use the default backend.
793+ :type backend: :py:class:`dns.asyncbackend.Backend` or ``None``
793794
794795 See :py:func:`dns.query.quic()` for the documentation of the other
795796 parameters, exceptions, and return type of this method.
@@ -910,8 +911,9 @@ async def inbound_xfr(
910911 """Conduct an inbound transfer and apply it via a transaction from the
911912 txn_manager.
912913
913- *backend*, a ``dns.asyncbackend.Backend``, or ``None``. If ``None``,
914- the default, then dnspython will use the default backend.
914+ :param backend: The async backend. If ``None`` (the default), dnspython
915+ will use the default backend.
916+ :type backend: :py:class:`dns.asyncbackend.Backend` or ``None``
915917
916918 See :py:func:`dns.query.inbound_xfr()` for the documentation of
917919 the other parameters, exceptions, and return type of this method.
0 commit comments