Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[doc] State clearly that open() 'file' param is "name" attr of the result#142694

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
GrigoriiKashchenko wants to merge2 commits intopython:main
base:main
Choose a base branch
Loading
fromGrigoriiKashchenko:doc-open-name-attr

Conversation

@GrigoriiKashchenko
Copy link

@GrigoriiKashchenkoGrigoriiKashchenko commentedDec 14, 2025
edited by github-actionsbot
Loading

Summary

Update documentation to clearly state that thefile argument passed toopen() is stored as thename attribute of the returned file object.

Changes Made

  1. Doc/library/functions.rst: Added explicit documentation for theopen() function
  2. Doc/library/io.rst: Updated documentation forFileIO.name and added missingIOBase.name attribute

Key Clarifications

  • Thename attribute stores exactly what was passed as thefile argument
  • It can be string, bytes, integer file descriptor, or other representation
  • This behavior is preserved for backward compatibility
  • Added.. versionchanged:: 3.13 directive to document the clarification

Testing

  • Verified documentation builds correctly
  • Behavior matches existing Python implementation
  • Cross-references between functions.rst and io.rst are consistent

Closesgh-62734


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

[doc] Clarify that open() file param is saved as name attribute
Clarify FileIO.name and IOBase.name documentation to match functions.rst
@python-cla-bot
Copy link

The following commit authors need to sign the Contributor License Agreement:

CLA not signed

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

Reviewers

No reviews

Assignees

No one assigned

Labels

awaiting reviewdocsDocumentation in the Doc dirskip news

Projects

Status: Todo

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[doc] State clearly that open() 'file' param is "name" attr of the result

1 participant

@GrigoriiKashchenko

[8]ページ先頭

©2009-2026 Movatter.jp