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

gh-112510: Addreadline.backend for the backend readline uses#112511

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

Merged
encukou merged 7 commits intopython:mainfromgaogaotiantian:readline-backend
Dec 1, 2023

Conversation

@gaogaotiantian
Copy link
Member

@gaogaotiantiangaogaotiantian commentedNov 29, 2023
edited by github-actionsbot
Loading

fjqz177 and Constantin1489 reacted with thumbs up emoji
@gaogaotiantian
Copy link
MemberAuthor

@encukou@corona10 could you take a look? Thanks!

# If this fails, the test is skipped because SkipTest will be raised
readline=import_module('readline')
ifreadline.__doc__and"libedit"inreadline.__doc__:
ifreadline.backend=="editline":
Copy link
Member

Choose a reason for hiding this comment

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

For just internal usage, why not just use readline._backend?

Co-authored-by: Donghee Na <donghee.na92@gmail.com>
Copy link
Member

@corona10corona10 left a comment
edited
Loading

Choose a reason for hiding this comment

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

LGTM from my view. But I will leave it to@encukou since we have to exportbackend as the public. Once we export it we should maintain it for a long time and Petr is the expert in this area.

@encukou
Copy link
Member

Thank you!
My main worry here is that we might get into a situation likesys.version/sys.version_info, where the earlier “stringly typed” attribute has a better name.
Are we likely to need something likebackend.name &backend.version in the future? If we do, will it be OK to keepbackend and a newbackend_version?
Or am I overthinking this?


Could you add a test to assertbackend is either"readline" or"editline"?

@gaogaotiantian
Copy link
MemberAuthor

Thank you! My main worry here is that we might get into a situation likesys.version/sys.version_info, where the earlier “stringly typed” attribute has a better name. Are we likely to need something likebackend.name &backend.version in the future? If we do, will it be OK to keepbackend and a newbackend_version? Or am I overthinking this?

Could you add a test to assertbackend is either"readline" or"editline"?

Very helpful insight! From my observation, the difference between different versions of the same library is significantly less important than the difference between the two libraries. I can't guarantee that the version of the backend will not ever be used at all in the future, but I would guess that's a very rare case. Bothreadline andeditline seems to be relatively consistent between versions.

That being said, I think using a single string type forreadline.backend is reasonable, and it probably makes the life easier for the users compared to having a(name, version) tuple for the attribute and the users would have to doreadline.backend[0] == 'readline' in most of the cases.

If in the future,readline oreditline has a breaking change in some version that affects many users, having areadline.backend_version is not the end of the world.

encukou reacted with thumbs up emoji

@gaogaotiantian
Copy link
MemberAuthor

I think we are done with the review for this PR? We should merge this before#107748 so it can use thebackend instead of checking__doc__

encukou
encukou previously approved these changesDec 1, 2023
@encukouencukou dismissed theirstale reviewDecember 1, 2023 13:22

One more thing!

@encukou
Copy link
Member

One more thing: the docs entry needs aversionadded. I updated the PR directly to avoid a round of review ping-pong; hope you don't mind.

(And I fell into the trap of thinking this is simple enough to use GitHub UI rather than a local clone...)

@encukouencukouenabled auto-merge (squash)December 1, 2023 13:40
@encukouencukou merged commitc298238 intopython:mainDec 1, 2023
@gaogaotiantian
Copy link
MemberAuthor

Thanks for the quick review!

@gaogaotiantiangaogaotiantian deleted the readline-backend branchDecember 1, 2023 18:07
aisk pushed a commit to aisk/cpython that referenced this pull requestFeb 11, 2024
…pythonGH-112511)Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>Co-authored-by: Donghee Na <donghee.na92@gmail.com>
Glyphack pushed a commit to Glyphack/cpython that referenced this pull requestSep 2, 2024
…pythonGH-112511)Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>Co-authored-by: Donghee Na <donghee.na92@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@encukouencukouencukou left review comments

@corona10corona10corona10 approved these changes

Assignees

@encukouencukou

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@gaogaotiantian@encukou@corona10

[8]ページ先頭

©2009-2025 Movatter.jp