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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
py3: fix sage.libs.readline.pyx for python3 #27275
Comments
Branch: u/vklein/27275 |
Commit: |
New commits:
|
comment:3
seems ok at first sight.. Erik, do you approve ? |
comment:4
I'm not sure. I don't think |
comment:5
Couldn't we instead modify the |
comment:7
Replying to @embray:
I will try that. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:9
@embray I don't see drawback with your solution, let's try this. |
comment:11
Just one other minor nit to pick (with the existing tests before this ticket): diff --git a/src/sage/libs/readline.pyx b/src/sage/libs/readline.pyx
index e3e7671..43279a7 100644
--- a/src/sage/libs/readline.pyx
+++ b/src/sage/libs/readline.pyx
@@ -20,7 +20,8 @@ line is removed::
sage: with interleaved_output():
....: print('output')
- ....: print('current line: ' + repr(copy_text(0, get_end())))
+ ....: print('current line: ' +
+ ....: repr(copy_text(0, get_end())))
....: print('cursor position: {}'.format(get_point()))
output
current line: '' with the Python 3 But don't bother unless you feel like it. |
Reviewer: Erik Bray |
comment:12
Similarly the line
|
comment:13
Replying to @embray:
Oh thanks ! That's good to know. I will make these little modifications. |
Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:
|
comment:15
Did you test this? When you do |
comment:16
Replying to @embray:
Be careful with
versus Python3:
So I would not use the comma version in order to be Python2/3 compatible. |
comment:17
Replying to @embray:
I think i have. But i am not sure anymore. And i don't understand why the last patchbot is green. I am currently doing more tests. |
comment:18
Well that's pretty strange even if with python2 you get that in sage console:
The doctest
still pass. And for python3 the doctest framework doesn't seem to care if there is one or two spaces between Even if it pass i think it's more clear and consistent to rollback to the |
comment:19
Replying to @tscrim:
We're using |
comment:20
Replying to @vinklein:
I'm not sure why it is because that's wrong. For the doctests we are using the Python 3 print() function where possible. |
comment:21
See e.g. #23551. |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits: |
comment:24
I think for miscellaneous doctests where it's really beside the point, I think it should be fine, and better to use future-proof best practices. It's just in tutorials and other educational documentation for beginners where one needs to be a little more careful about this (or better yet, teach the difference!) I hope we can move toward using the print function in the REPL even on Python 2 before long... |
comment:26
Rebased on 8.7.beta4 and fix doctests with |
comment:27
ok, let it be. |
Changed reviewer from Erik Bray to Erik Bray, Frédéric Chapoton |
Changed branch from u/vklein/27275 to |
fix doctests failures : sage -t --long src/sage/libs/readline.pyx # 10 doctests failed
CC: @fchapoton @embray
Component: python3
Author: Vincent Klein
Branch/Commit:
7ccd2a5
Reviewer: Erik Bray, Frédéric Chapoton
Issue created by migration from https://trac.sagemath.org/ticket/27275
The text was updated successfully, but these errors were encountered: