summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmart+matt@google.com <smart+matt@google.com@09200d28-7f98-11dd-ad27-0f66e57d2035>2010-04-22 14:19:03 +0000
committersmart+matt@google.com <smart+matt@google.com@09200d28-7f98-11dd-ad27-0f66e57d2035>2010-04-22 14:19:03 +0000
commitf06bb73b681ec4db60310a85916d274a245ae181 (patch)
tree6b8425e15426fdfa5405433e11f81893c942b7b3
parentb499da087e932ff53b4be0805d60bb873dc4ed0f (diff)
downloadipaddr-py-f06bb73b681ec4db60310a85916d274a245ae181.tar.gz
Edited wiki page through web user interface.
git-svn-id: https://ipaddr-py.googlecode.com/svn@159 09200d28-7f98-11dd-ad27-0f66e57d2035
-rw-r--r--wiki/UpgradingTo2x.wiki10
1 files changed, 4 insertions, 6 deletions
diff --git a/wiki/UpgradingTo2x.wiki b/wiki/UpgradingTo2x.wiki
index 47547d3..ab1de13 100644
--- a/wiki/UpgradingTo2x.wiki
+++ b/wiki/UpgradingTo2x.wiki
@@ -1,7 +1,5 @@
This page describes the major differences between the 1.x and 2.x branches of ipaddr and what changes you need to make to your code to begin using the new versions.
-(still a work in progress)
-
= Introduction =
Lots of work has gone into making the 2.x branch of ipaddr easier to use and better overall. Since we'd like as many people as possible to use to new version, here's a short summary of the major changes and what you'll have to do to your code to make it work with the new version.
@@ -62,10 +60,11 @@ ipaddr 1.x relied mostly on the monolithic IP(string) constructor. This would re
=== Accessors ===
-2.x makes much greater use of pythons special methods for returning the integer or string representations of an object.
+2.x makes much greater use of Python's special methods for returning the integer or string representations of an object.
|| 1.x || 2.x ||
-|| network.ip_ext || str(network) ||
+|| network.ip_ext || str(network) or network.compressed ||
+|| network.ip_ext_full || network.exploded ||
|| network.ip || int(network) ||
|| network.netmask_ext || str(network.netmask) ||
|| network.netmask || int(network.netmask) ||
@@ -74,10 +73,9 @@ ipaddr 1.x relied mostly on the monolithic IP(string) constructor. This would re
Additionally, the various network attributes ({{{ .ip, .ip_ext, .network, .network_ext, .broadcast, .broadcast_ext }}}) used to return either strings or ints. As mentioned before, they return ipaddr address objects, either of type {{{IPv4Address}}} or {{{IPv6Address}}}.
-
=== Exceptions ===
-In general, the exceptions are much more "pythonic". No more inventing exceptions for every corner case since python politely furnishes us with almost every exception type we already need. In the couple of cases where it does actually make sense for us to have our own exceptions, they're now subclassed from ValueError so you can shortcut the exception catching if you'd like and just catch ValueError.
+In general, the exceptions are much more Pythonic. No more inventing exceptions for every corner case since Python politely furnishes us with almost every exception type we already need. In the couple of cases where it does actually make sense for us to have our own exceptions, they're now subclassed from ValueError so you can shortcut the exception catching if you'd like and just catch ValueError.
|| 1.x || 2.x ||