MCPcopy Create free account
hub / github.com/python/cpython / _string_from_ip_int

Method _string_from_ip_int

Lib/ipaddress.py:1242–1252  ·  view source on GitHub ↗

Turns a 32-bit integer into dotted decimal notation. Args: ip_int: An integer, the IP address. Returns: The IP address as a string in dotted decimal notation.

(cls, ip_int)

Source from the content-addressed store, hash-verified

1240
1241 @classmethod
1242 def _string_from_ip_int(cls, ip_int):
1243 """Turns a 32-bit integer into dotted decimal notation.
1244
1245 Args:
1246 ip_int: An integer, the IP address.
1247
1248 Returns:
1249 The IP address as a string in dotted decimal notation.
1250
1251 """
1252 return '.'.join(map(str, ip_int.to_bytes(4, 'big')))
1253
1254 def _reverse_pointer(self):
1255 """Return the reverse DNS pointer name for the IPv4 address.

Callers 9

__str__Method · 0.45
__str__Method · 0.45
with_prefixlenMethod · 0.45
with_netmaskMethod · 0.45
with_hostmaskMethod · 0.45
with_prefixlenMethod · 0.45
with_netmaskMethod · 0.45
with_hostmaskMethod · 0.45

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected