timmerk / ipaddr-py

Automatically exported from code.google.com/p/ipaddr-py
0 stars 0 forks source link

[PATCH] two minor comment nits #60

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Index: ipaddr.py
===================================================================
--- ipaddr.py   (revision 164)
+++ ipaddr.py   (working copy)
@@ -36,7 +36,7 @@

 def IPAddress(address, version=None):
-    """Take an IP string/int and return an object of the correct type.
+    """Take an IP string and return an object of the correct type.

     Args:
         address: A string or integer, the IP address.  Either IPv4 or
@@ -44,7 +44,7 @@
           be considered to be IPv4 by default.
         version: An Integer, 4 or 6. If set, don't try to automatically
           determine what the IP address type is. important for things
-          like IPAddress(1), which could be IPv4, '0.0.0.0.1',  or IPv6,
+          like IPAddress(1), which could be IPv4, '0.0.0.1',  or IPv6,
           '::1'.

     Returns:

Original issue reported on code.google.com by colmm...@gmail.com on 2 May 2010 at 4:37

GoogleCodeExporter commented 9 years ago
thanks.

note, ipaddr.IPAddress(1) works, so the first part of the docstring is actually 
correct. fixed in 165

Original comment by pmo...@google.com on 10 May 2010 at 5:34

GoogleCodeExporter commented 9 years ago
Ah, I was interpreting the "string/int" as meaning VLSM CIDR notation. Mainly 
because that's what the 
documentation for IPNetwork reads like, and it seemed like a copy and paste. 

In that case I'd suggest making this change;

IPAddress;  "Take an IP [string|int] and return ..."
IPNetwork:  "Take an IP [string|int]/int and return ... "

it's confusing to have / as both a separator and an OR operator. Anyway, it's 
not a big deal - but I did find it a 
bit confusing when I first went to use the library.

Original comment by colmm...@gmail.com on 12 May 2010 at 4:32