New submission from Warren Turkal:
It would be very useful to be able to not only iterate through subnets, but
also index a subnet. For example, I would really like to be able to do the
following:
import ipaddress as ipa
net = ipa.ip_network('10.0.0.0/8')
print(net.subnets(prefixlen_diff=2
Warren Turkal added the comment:
Won't that instantiate an object for each item in the list though? For example:
list(net.subnets(prefixlen_diff=16))[499]
This take a long time. I was trying to think of a way to lazily instantiate.
For example, I don't want to create 65536 network objects
Warren Turkal w...@penguintechs.org added the comment:
Thanks for fixing this issue. You guys are great!
wt
On Sat, Jul 21, 2012 at 8:00 PM, R. David Murray rep...@bugs.python.orgwrote:
R. David Murray rdmur...@bitdance.com added the comment:
Committed. Thanks, Jeff. By the way
Warren Turkal w...@penguintechs.org added the comment:
Using argparse.REMAINDER will not help for my problem in my real program as the
first arg needs to be handled by my program and mapped into the real binary
name.
If I recall correctly from memory, the following is what happened when I
Changes by Warren Turkal w...@penguintechs.org:
--
versions: +Python 3.3, Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13922
Warren Turkal w...@penguintechs.org added the comment:
[1] sounds somewhere related and more complicated than what I was asking for. I
would think that it would need to wrap bulleted lists in a sane way in addition
to what I asked for here.
Also, [1] seems to apply to the option help text
Warren Turkal w...@penguintechs.org added the comment:
I wanted to include a minimal example script, so here it is. If you run this
like so:
$ ./test.py -- blah -- blah2
you will get the the following output:
Namespace(args=['blah2'], target=['blah'])
I would have expected the following
Warren Turkal w...@penguintechs.org added the comment:
It doesn't look like that file got included last time, so here's a second try.
--
Added file: http://bugs.python.org/file24424/test.py
___
Python tracker rep...@bugs.python.org
http
New submission from Warren Turkal w...@penguintechs.org:
I have a program that runs something like the following:
$ hack run -- :target --arg1 --arg2 arg3 arg4
This basically runs a program identified by :target with the args. However, I
cannot pass -- to the program. For example, if I type
New submission from Warren Turkal w...@penguintechs.org:
It would be really nice to have a formatter for argparse that would respect
explicit new lines while still wrapping lines otherwise.
This would allow the description and epilog to have be a little more structured
while still getting
10 matches
Mail list logo