Skip to content

Commit a33fca9

Browse files
committed
docs/usocket: Document inet_ntop(), inet_pton().
1 parent d1cd533 commit a33fca9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/library/usocket.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,22 @@ Functions
105105
from an exception object). The use of negative values is a provisional
106106
detail which may change in the future.
107107

108+
.. function:: inet_ntop(af, bin_addr)
109+
110+
Convert a binary network address *bin_addr* of the given address family *af*
111+
to a textual representation::
112+
113+
>>> usocket.inet_ntop(usocket.AF_INET, b"\x7f\0\0\1")
114+
'127.0.0.1'
115+
116+
.. function:: inet_pton(af, txt_addr)
117+
118+
Convert a textual network address *txt_addr* of the given address family *af*
119+
to a binary representation::
120+
121+
>>> usocket.inet_pton(usocket.AF_INET, "1.2.3.4")
122+
b'\x01\x02\x03\x04'
123+
108124
Constants
109125
---------
110126

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy