GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-66060: Use actual class name in some `_io` type's `__repr__` by aisk · Pull Request #30824 · python/cpython

Conversation

@aisk

@aisk aisk commented Jan 23, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

https://bugs.python.org/issue21861

  • Issue: io class name are hardcoded in reprs #66060

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Jan 23, 2022
@bedevere-bot bedevere-bot added the awaiting review label Jan 23, 2022
@aisk
aisk force-pushed the bpo-21861 branch 2 times, most recently from 8ab3a0d to a746e0d Compare January 23, 2022 10:34
@aisk

aisk commented Feb 1, 2022

Copy link
Copy Markdown
Member Author

Hi @taleinat can you take a look at this please?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aisk
bpo-21861: fix __repr__ for io subclasses
9a80e2b
@aisk
aisk force-pushed the bpo-21861 branch from a746e0d to 9a80e2b Compare May 6, 2022 14:56
@ezio-melotti ezio-melotti removed the CLA signed label Jul 13, 2022
@aisk
Merge branch 'main' into bpo-21861
36b91cc
@arhadthedev arhadthedev added extension-modules C modules in the Modules dir topic-IO labels Apr 3, 2023
@arhadthedev arhadthedev changed the title bpo-21861: use the object's actual class name in some io classes' repr method gh-66060: use the object's actual class name in some io classes' repr method Apr 3, 2023
@arhadthedev

arhadthedev commented Apr 3, 2023

Copy link
Copy Markdown
Member

@serhiy-storchaka, @rhettinger as participants of the parent issue.

aisk reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aisk

This comment was marked as outdated.

Sign in to view
@arhadthedev

This comment was marked as off-topic.

Sign in to view
@aisk

This comment was marked as off-topic.

Sign in to view
@erlend-aasland
erlend-aasland self-requested a review January 6, 2024 20:46
@erlend-aasland erlend-aasland changed the title gh-66060: use the object's actual class name in some io classes' repr method gh-66060: Use actual class name in some _io type's __repr__ Jan 6, 2024
@erlend-aasland
Merge branch 'main' into bpo-21861
284e41f
erlend-aasland
erlend-aasland reviewed Jan 6, 2024
View reviewed changes

@erlend-aasland erlend-aasland left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks! We normally truncate the class names with the %.100s or %.200s format specifiers. I think it would be nice to follow that practice. Can you update the format strings?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
aisk added 2 commits January 10, 2024 00:07
@aisk
using %.100s as class name format
a27ec5c
@aisk
ensure test files got closed
8268a9a
@aisk

aisk commented Jan 9, 2024

Copy link
Copy Markdown
Member Author

Thank you for your review. I have implemented the changes you recommended as described above.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland
erlend-aasland reviewed Jan 9, 2024
View reviewed changes
Comment thread Modules/_io/winconsoleio.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@aisk
follow the PEP7 to format winconsoleio_repr function
31e305b
erlend-aasland
erlend-aasland approved these changes Jan 9, 2024
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Jan 9, 2024
@erlend-aasland

erlend-aasland commented Jan 9, 2024

Copy link
Copy Markdown
Contributor

Thanks, @aisk! I'll land this later tonight (CET).

aisk reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland erlend-aasland self-assigned this Jan 9, 2024
@erlend-aasland erlend-aasland mentioned this pull request Jan 9, 2024
bpo-21861: Improve _io.FileIO.__repr__ #14774
Closed
@erlend-aasland erlend-aasland linked an issue Jan 9, 2024 that may be closed by this pull request
io class name are hardcoded in reprs #66060
Closed
@erlend-aasland
erlend-aasland merged commit 623b338 into python:main Jan 9, 2024
@serhiy-storchaka serhiy-storchaka mentioned this pull request Apr 10, 2022
io class name are hardcoded in reprs #66060
Closed
@bedevere-app bedevere-app Bot removed the awaiting merge label Jan 9, 2024
@aisk
aisk deleted the bpo-21861 branch January 10, 2024 09:25
kulikjak pushed a commit to kulikjak/cpython that referenced this pull request Jan 22, 2024
@aisk @kulikjak
pythongh-66060: Use actual class name in _io type's __repr__ (python#…
0327886
…30824)

Use the object's actual class name in the following _io type's __repr__:
- FileIO
- TextIOWrapper
- _WindowsConsoleIO
aisk added a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@aisk
pythongh-66060: Use actual class name in _io type's __repr__ (python#…
18a6235
…30824)

Use the object's actual class name in the following _io type's __repr__:
- FileIO
- TextIOWrapper
- _WindowsConsoleIO
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@aisk @Glyphack
pythongh-66060: Use actual class name in _io type's __repr__ (python#…
0fed9e7
…30824)

Use the object's actual class name in the following _io type's __repr__:
- FileIO
- TextIOWrapper
- _WindowsConsoleIO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@erlend-aasland erlend-aasland erlend-aasland approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@erlend-aasland erlend-aasland

Labels

extension-modules C modules in the Modules dir topic-IO

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

io class name are hardcoded in reprs

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@aisk @arhadthedev @erlend-aasland @the-knights-who-say-ni @ezio-melotti @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.