This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Gary.van.der.Merwe
Recipients Gary.van.der.Merwe
Date 2014-11-28.08:54:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1417164846.5.0.804919214198.issue22962@psf.upfronthosting.co.za>
In-reply-to
Content
Currently if one has an ip address in int or IPv4Address/IPv6Address form, it is not possilbe to create a ip_interface or ip_network from that with specific prefix length, without first converting the address into string form, and then appending the prefixlen 

Please could an optional prefixlen argument to ip_interface and ip_network (and the __init__ functions for their backing classes) so that one can do this.

e.g: it should work like this:

>>> ipaddress.ip_interface(167772161, prefixlen=24)
IPv4Interface('10.0.0.1/24')

I would like to do a patch for this. I would just first like some feedback as to whether a patch for this would accepted.
History
Date User Action Args
2014-11-28 08:54:06Gary.van.der.Merwesetrecipients: + Gary.van.der.Merwe
2014-11-28 08:54:06Gary.van.der.Merwesetmessageid: <1417164846.5.0.804919214198.issue22962@psf.upfronthosting.co.za>
2014-11-28 08:54:06Gary.van.der.Merwelinkissue22962 messages
2014-11-28 08:54:06Gary.van.der.Merwecreate