Message78683
> 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. |
|
Date |
User |
Action |
Args |
2009-01-01 02:33:14 | pmoody | set | recipients:
+ pmoody, gvanrossum, loewis, exarkun, vstinner, giampaolo.rodola, benjamin.peterson, mattsmart, shields, drkjam |
2009-01-01 02:33:13 | pmoody | link | issue3959 messages |
2009-01-01 02:33:12 | pmoody | create | |
|