Skip to content

gh-131885: Document / for codecs functions - #131992

Merged
vstinner merged 1 commit into
python:mainfrom
donbarbos:issue-131885-codecs
Apr 14, 2025
Merged

gh-131885: Document / for codecs functions#131992
vstinner merged 1 commit into
python:mainfrom
donbarbos:issue-131885-codecs

Conversation

@donbarbos

@donbarbosdonbarbos commented Apr 1, 2025

Copy link
Copy Markdown
Contributor

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-appbedevere-appBot added awaiting review docs Documentation in the Doc dir skip news labels Apr 1, 2025
@donbarbosdonbarbos changed the title Document / for codecs functionsgh-131885: Document / for codecs functionsApr 1, 2025

@vstinnervstinner left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@vstinner
vstinner merged commit bd47ec9 into python:mainApr 14, 2025
@github-project-automationgithub-project-automationBot moved this from Todo to Done in Docs PRsApr 14, 2025
@vstinner

Copy link
Copy Markdown
Member

Merged, thank you.

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

Labels

docsDocumentation in the Doc dirskip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants

@donbarbos@vstinner