def _prefixlenToNetmask(prefixlen, version):
 if (prefixlen == 0):
  return 0
 elif (prefixlen < 0):
  raise ValueError('Prefixlen must be > 0')
 return (((2 << (prefixlen - 1)) - 1) << (_ipVersionToLen(version) - prefixlen))

def _prefixlenToNetmask ( prefixlen , version ) : if ( prefixlen == 0 ) : return 0 elif ( prefixlen < 0 ) : raise ValueError ( 'Prefixlen must be > 0' ) return ( ( ( 2 << ( prefixlen - 1 ) ) - 1 ) << ( _ipVersionToLen ( version ) - prefixlen ) )
return a mask of n bits as a long integer .