On Wed, Aug 19, 2009 at 9:07 PM, Eric Smith<e...@trueblade.com> wrote: > Fred Drake wrote: >> >> On Aug 19, 2009, at 6:01 PM, Peter Moody wrote: >>> >>> just to double check, it's fine for IPNetwork to remain hashable if >>> set_prefix() actually returned a new object, correct? >> >> >> The name would be confusing, though. Perhaps using_prefix() would be more >> clear. > > I think you'd be better off either doing this with an optional parameter to > __init__, or a class method factory function (maybe from_prefix or similar). > I don't see why it should be a method on an existing object. >
while not the the prettiest, you can already (ignoring the set_prefix) do something like: >>> newobject = ipaddr.IP(str(o.network) + "/new prefix") Is this sufficient? _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com