8000 bpo-45975: Simplify some while-loops with walrus operator by nickdrozd · Pull Request #29347 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-45975: Simplify some while-loops with walrus operator #29347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Nov 26, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add missing parens
  • Loading branch information
nickdrozd committed Mar 28, 2022
commit 5093f92e3c805e1e5a72869a967aba91128cdd04
2 changes: 1 addition & 1 deletion Lib/base64.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def b85decode(b):
def encode(input, output):
"""Encode a file; input and output are binary files."""
while s := input.read(MAXBINSIZE):
while len(s) < MAXBINSIZE and ns := input.read(MAXBINSIZE-len(s)):
while len(s) < MAXBINSIZE and (ns := input.read(MAXBINSIZE-len(s))):
s += ns
line = binascii.b2a_base64(s)
output.write(line)
Expand Down
0