Issue #14814: document the Interface APIs and fix various problems with the string representations (initial patch by Eli Bendersky).
diff --git a/Lib/ipaddress.py b/Lib/ipaddress.py
index c9338c5..cfc370c 100644
--- a/Lib/ipaddress.py
+++ b/Lib/ipaddress.py
@@ -1336,7 +1336,8 @@
@property
def with_prefixlen(self):
- return self
+ return '%s/%s' % (self._string_from_ip_int(self._ip),
+ self._prefixlen)
@property
def with_netmask(self):
@@ -1948,11 +1949,13 @@
@property
def with_prefixlen(self):
- return self
+ return '%s/%s' % (self._string_from_ip_int(self._ip),
+ self._prefixlen)
@property
def with_netmask(self):
- return self.with_prefixlen
+ return '%s/%s' % (self._string_from_ip_int(self._ip),
+ self.netmask)
@property
def with_hostmask(self):