bpo-34764: improve docs example of iter() with sentinel value#11222
Conversation
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Our records indicate we have not received your CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You can check yourself to see if the CLA has been received. Thanks again for your contribution, we look forward to reviewing it! |
|
Actually is it necessary to set |
rhettinger
left a comment
There was a problem hiding this comment.
I would like to keep something closer to the original. The random() example is not a motivating use case. Instead, consider a block-reader example or some other non-toy use case:
# Read data in chunks
for block in iter(partial(f.read, 128), ''):
...
This partial() can be replaced with lambda: f.read(128) or with a def statement.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
bad271d to
f6f0860
Compare
|
Thanks @rhettinger, I have tried to make the requested changes; please review again |
|
Doctest fails on Travis since |
7bcbf27 to
fc05a24
Compare
9f7a9d1 to
e15c552
Compare
1bb9d6c to
ab611eb
Compare
87e4d8a to
747ee53
Compare
rhettinger
left a comment
There was a problem hiding this comment.
Fixed-length block reads would be more typical for binary data.
272b50e to
b01f506
Compare
|
Thanks @rhettinger for your patience! I have made the requested changes (and fixed the indentation); please review again |
|
Thanks @chris-rands for the PR, and @rhettinger for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
|
GH-11301 is a backport of this pull request to the 3.7 branch. |
https://bugs.python.org/issue34764