Skip to content

gh-131885: Document / for codecs functions #131992

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 1 commit into from
Apr 14, 2025

Conversation

donBarbos
Copy link
Contributor

@donBarbos donBarbos commented Apr 1, 2025

1. I found that CodecInfo class signature contains an undocumented (non-public) _is_text_encoding argument:

cpython/Lib/codecs.py

Lines 94 to 96 in c2ac662

def __new__(cls, encode, decode, streamreader=None, streamwriter=None,
incrementalencoder=None, incrementaldecoder=None, name=None,
*, _is_text_encoding=None):

Signature, inspect.signature(codecs.CodecInfo):

<Signature (encode, decode, streamreader=None, streamwriter=None, incrementalencoder=None, incrementaldecoder=None, name=None, *, _is_text_encoding=None)>

I don't think this should be documented, but I thought I'd point it out just in case.


2. I'm not a fan of using / and I also want to point out that it doesn't seem natural for codecs functions to use positional-only arguments, since they are only used in the functions that I updated. I would suggest getting rid of / in the code instead of documenting it.


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

@bedevere-app bedevere-app bot added awaiting review docs Documentation in the Doc dir skip news labels Apr 1, 2025
@github-project-automation github-project-automation bot moved this to Todo in Docs PRs Apr 1, 2025
@donBarbos donBarbos changed the title Document / for codecs functions gh-131885: Document / for codecs functions Apr 1, 2025
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM

@python-cla-bot
Copy link

python-cla-bot bot commented Apr 6, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@vstinner vstinner merged commit bd47ec9 into python:main Apr 14, 2025
35 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Apr 14, 2025
@vstinner
Copy link
Member

Merged, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants