Skip to content

Conversation

@donbarbos
Copy link
Contributor

@donbarbosdonbarbos 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-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
Copy link
Member

@vstinnervstinner 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

All commit authors signed the Contributor License Agreement.

CLA signed

@vstinnervstinner merged commit bd47ec9 into python:mainApr 14, 2025
35 checks passed
@github-project-automationgithub-project-automationbot moved this from Todo to Done in Docs PRsApr 14, 2025
@vstinner
Copy link
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