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
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
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
<http://bugs.python.org/issue20
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
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
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, and
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
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
<http://bugs.py
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
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
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
impl
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 brakin
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.
Wit
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
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
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
<http://bugs.python.org/issue20
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
res
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
<http://bugs.py
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
<http://bugs.python.org/issue20
Michel Albert added the comment:
I don't quite see how the operator module could help. I don't have much
experience with it though, so I might be missing something...
I don't see how I can relate one check to the other. The example I gave in the
patch review was the follo
Michel Albert added the comment:
New patch with proposed changes.
--
Added file: http://bugs.python.org/file43537/net-in-net-r6.patch
___
Python tracker
<http://bugs.python.org/issue20
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
<http://bugs.python.org/is
22 matches
Mail list logo