[issue20815] ipaddress unit tests PEP8

2014-03-01 Thread Michel Albert
New submission from Michel Albert: While I was looking at the source of the ipaddress unit-tests, I noticed a couple of PEP8 violations. This patch fixes these (verified using the ``pep8`` tool). There are no behavioural changes. Only white-space. Test-cases ran successfully before

[issue20815] ipaddress unit tests PEP8

2014-03-01 Thread Michel Albert
Michel Albert added the comment: Thanks for the quick reply! I did not know the pep8 tool added it's own rules :( I have read PEP8 a long while ago and have since relied on the tool to do the right thing. Many of it's idiosyncrasies have probably made their way into my blood since

[issue20815] ipaddress unit tests PEP8

2014-03-02 Thread Michel Albert
Michel Albert added the comment: Here's a new patch which addresses white-space issues without touching the old tests. -- Added file: http://bugs.python.org/file34265/test_ipaddress_pep8-r3.patch ___ Python tracker rep...@bugs.python.org http

[issue20825] containment test for ip_network in ip_network

2014-03-02 Thread Michel Albert
New submission from Michel Albert: The ipaddress module always returns ``False`` when testing if a network is contained in another network. However, I feel this should be a valid test. No? Is there any reason why this is fixed to ``False``? In case not, here's a patch which implements

[issue20825] containment test for ip_network in ip_network

2014-03-02 Thread Michel Albert
Michel Albert added the comment: Hmm... after thinking about this, I kind of agree. I was about to state something about the fact that you could consider networks like an ordered set. And use that to justify my addition :) But the more I think about it, the more I am okay with your point. I

[issue20826] Faster implementation to collapse consecutive ip-networks

2014-03-02 Thread Michel Albert
New submission from Michel Albert: This alternative implementation runs over the ``addresses`` collection only once, and backtracks only if necessary. Inspired by a shift-reduce approach. Technically both are O(n), so the best case is always the same. But the old implementation runs over

[issue20815] ipaddress unit tests PEP8

2014-03-03 Thread Michel Albert
Michel Albert added the comment: I strongly agree with Raymond's points! They are all valid. I should note, that I submitted this patch to - as mentioned by Nick - familiarise myself with the patch submission process. I decided to make harmless changes which won't risk braking anything

[issue20825] containment test for ip_network in ip_network

2014-03-04 Thread Michel Albert
Michel Albert added the comment: I second supernet_of and subnet_of. I'll implement it as soon as I get around it. I have been thinking about using ``in`` and ``=`` and, while I initially liked the idea for tests, I find both operators too ambiguous. With ``in`` there's the already mentioned

[issue20825] containment test for ip_network in ip_network

2014-03-06 Thread Michel Albert
Michel Albert added the comment: Here's a new patch implementing both ``subnet_of`` and ``supernet_of``. It also contains the relevant docs and unit-tests. -- Added file: http://bugs.python.org/file34292/net-in-net-r2.patch ___ Python tracker rep

[issue20825] containment test for ip_network in ip_network

2014-03-11 Thread Michel Albert
Michel Albert added the comment: Yes. I signed it last Friday if I recall correctly. As I understood it, the way for you to tell if it's done, is that my username will be followed by an asterisk. But I'm not in a hurry. Once I get the confirmation, I can just ping you again via a comment

[issue20815] ipaddress unit tests PEP8

2014-03-12 Thread Michel Albert
Michel Albert added the comment: Did so already last weekend. I suppose it will take some time to be processed. I can ping you via a message here once I receive the confirmation. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue20815] ipaddress unit tests PEP8

2014-03-23 Thread Michel Albert
Michel Albert added the comment: It seems the contributor agreement form has been processed. As I understand it, the asterisk on my name confirms this. I also verified that this patch cleanly applies to the most recent revision. -- ___ Python

[issue20825] containment test for ip_network in ip_network

2014-03-23 Thread Michel Albert
Michel Albert added the comment: Hi again, The contribution agreement has been processed, and the patch still cleanly applies to the latest revision of branch `default`. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20825

[issue20826] Faster implementation to collapse consecutive ip-networks

2014-03-23 Thread Michel Albert
Michel Albert added the comment: Sorry for the late reply. I wanted to take some time and give a more detailed explanation. At least to the best of my abilities :) I attached a zip-file with my quick-and-dirty test-rig. The zip contains: * gendata.py -- The script I used to generate test

[issue20825] containment test for ip_network in ip_network

2014-03-23 Thread Michel Albert
Michel Albert added the comment: I made the changes mentioned by r.david.murray I am not sure if the modifications in ``Doc/whatsnew/3.5.rst`` are correct. I tried to follow the notes at the top of the file, but it's not clear to me if it should have gone into ``News/Misc`` or into ``Doc

[issue20825] containment test for "ip_network in ip_network"

2016-06-25 Thread Michel Albert
Michel Albert added the comment: I just realised that the latest patch on this no longer applies properly. I have fixed the issue and I am currently in the process of running the unit-tests which takes a while. Once those pass, I'll update some metadata and resubmit

[issue20825] containment test for "ip_network in ip_network"

2016-06-25 Thread Michel Albert
Michel Albert added the comment: Test pass properly. Is there anything else left to do? Here's the fixed patch (net-in-net-r4.patch) -- Added file: http://bugs.python.org/file43534/net-in-net-r4.patch ___ Python tracker <rep...@bugs.python.

[issue20825] containment test for "ip_network in ip_network"

2016-06-25 Thread Michel Albert
Michel Albert added the comment: Updated patch, taking into account notes from the previous patch-reviews -- Added file: http://bugs.python.org/file43535/net-in-net-r5.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.p

[issue20825] containment test for "ip_network in ip_network"

2016-06-25 Thread Michel Albert
Michel Albert added the comment: New patch with proposed changes. -- Added file: http://bugs.python.org/file43537/net-in-net-r6.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue20825] containment test for "ip_network in ip_network"

2016-09-13 Thread Michel Albert
Michel Albert added the comment: Are there any updates on this? Not sure if it's too late again to get it applied for the next Python (3.6) release? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue33827] Generators with lru_cache can be non-intuituve

2018-06-11 Thread Michel Albert
New submission from Michel Albert : Consider the following code: # filename: foo.py from functools import lru_cache @lru_cache(10) def bar(): yield 10 yield 20 yield 30 # This loop will work as expected for row in bar(): print(row