Skip to content

Conversation

@haukex
Copy link

@haukex haukex commented Dec 23, 2025

This makes z85encode analogous to a85encode and b85encode and allows the user to more easily meet the Z85 specification, which requires input lengths to be a multiple of 4. For details see #143103.

Documentation and tests included. Tests were verified against the Z85 reference implementation (which I wrapped into a Python module at haukex/py-z85).


📚 Documentation preview 📚: https://cpython-previews--143106.org.readthedocs.build/

@haukex haukex changed the title gh-143103: Added pad argument to base64.z85encode gh-143103: Added pad parameter to base64.z85encode Dec 23, 2025
@haukex
Copy link
Author

haukex commented Dec 23, 2025

All suggested changes applied including correcting "argument" to "parameter" in docs and commit message as well; the force push was just a squash of those changes.

Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am reviewing on my phone so check my suggestions before committing them (like typos or things like that).

This makes it analogous to `a85encode` and `b85encode` and allows the
user to more easily meet the Z85 specification, which requires input
lengths to be a multiple of 4.
@haukex
Copy link
Author

haukex commented Dec 24, 2025

@picnixz Thanks, I applied the changes and force-pushed the squashed result.

@haukex haukex requested a review from picnixz December 24, 2025 10:52
@picnixz
Copy link
Member

picnixz commented Dec 24, 2025

Thanks. In the future do not force push. We squash everything at the end so it doesn't help (it however gets harder for incremental reviews). Force-pushing is reserved when the history got messed up (e.g. bad merge)

@picnixz
Copy link
Member

picnixz commented Dec 24, 2025

Looks good but can you add a What's New entry as well for this change? just restate what you did in the NEWS entry (look at Doc/whatsnew/3.15.rst to see what to do). TiA

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

Side note. I thought about proposing to make pad a keyword-only parameter. Boolean arguments almost always should be passed by keyword, otherwise it is errorprone if you pass many arguments. This is not applied when the number of parameters is small (like in str.splitlines()), and this may be one of such cases. So I am not sure.

@serhiy-storchaka
Copy link
Member

AFAIK, not all minor changes deserve an entry in What's New.

@picnixz
Copy link
Member

picnixz commented Dec 24, 2025

I also wanted to suggest a kw-only but b85* functions do not have a kw-only and I think it is better to keep similar signatures for the encoding functions.

@picnixz
Copy link
Member

picnixz commented Dec 24, 2025

AFAIK, not all minor changes deserve an entry in What's New.

Yeah but I think it is nice to have features there. Otherwise they get burried in the bugfixes as well

Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also approve this. If you do not want to make the What's New entry it is fine. We can always do it as part of our copy-edit issue. It will also be easier so that you do not need to be careful about where to put the entry and how to format it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants