MCPcopy Index your code
hub / github.com/python/cpython / _ip_int_from_prefix

Method _ip_int_from_prefix

Lib/ipaddress.py:424–434  ·  view source on GitHub ↗

Turn the prefix length into a bitwise netmask Args: prefixlen: An integer, the prefix length. Returns: An integer.

(cls, prefixlen)

Source from the content-addressed store, hash-verified

422
423 @classmethod
424 def _ip_int_from_prefix(cls, prefixlen):
425 """Turn the prefix length into a bitwise netmask
426
427 Args:
428 prefixlen: An integer, the prefix length.
429
430 Returns:
431 An integer.
432
433 """
434 return cls._ALL_ONES ^ (cls._ALL_ONES >> prefixlen)
435
436 @classmethod
437 def _prefix_from_ip_int(cls, ip_int):

Callers 2

_make_netmaskMethod · 0.80
_make_netmaskMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected