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 pmoody
Recipients benjamin.peterson, drkjam, exarkun, giampaolo.rodola, gvanrossum, loewis, mattsmart, pmoody, shields, vstinner
Date 2009-01-01.02:33:11
SpamBayes Score 2.202413e-05
Marked as misclassified No
Message-id <8517e9350812311833q191a1c90k2757a7b87e673946@mail.gmail.com>
In-reply-to <1230776066.74.0.888962584654.issue3959@psf.upfronthosting.co.za>
Content
> I'm not sure which API in netaddr you're referring to.  If you want to
> construct that /24 with netaddr, then I would use
> netaddr.address.CIDR("1.1.1.0/24").  Offhand, I can't find an API which

netaddr.AddrRange

class AddrRange(__builtin__.object)
 |  A block of contiguous network addresses bounded by an arbitrary start and
 |  stop address. There is no requirement that they fall on strict bit mask
 |  boundaries, unlike L{CIDR} addresses.
 |

 |  __init__(self, first, last, klass=<class 'netaddr.address.Addr'>)
 |      Constructor.
 |
 |      @param first: start address for this network address range.
 |
 |      @param last: stop address for this network address range.
 |
 |      @param klass: (optional) class used to create each object returned.
 |          Default: L{Addr()} objects. See L{nrange()} documentations for
 |          additional details on options.

when looking through the code.google.com wiki, I couldn't find any
examples of creating addresses with netmasks and AddrRange was the
first thing I found when looking through pydoc.

> accepts two endpoints of a range to construct a network in netaddr.
> When I wrote about having separate types for individual addresses vs
> ranges of addresses in my previous comment, I had IP and CIDR
> respectively in mind, as opposed to ipaddr-py's single IPv4 class which
> can represent either.

and still having two separate classes represent the same thing seems odd to me.
History
Date User Action Args
2009-01-01 02:33:14pmoodysetrecipients: + pmoody, gvanrossum, loewis, exarkun, vstinner, giampaolo.rodola, benjamin.peterson, mattsmart, shields, drkjam
2009-01-01 02:33:13pmoodylinkissue3959 messages
2009-01-01 02:33:12pmoodycreate