dhellmann / py_stdlib_by_example

Source code and errata for "The Python Standard Library By Example"
Other
6 stars 2 forks source link

Base64 Encoding comment conflicts with code/output #5

Open dhellmann opened 4 years ago

dhellmann commented 4 years ago

On page 671 ("12.5.1 Base 64 Encoding"), the comment says "There will never be more than 2 padding bytes". However the code says "padding = 3 - (num_initial % 3)" which I suspect should read "padding = 2 - (num_initial % 3)". This is confirmed in the output below where it reads "Expect 3 padding bytes".

dhellmann commented 4 years ago

pystdlib_2-diff.txt