-
-
Notifications
You must be signed in to change notification settings - Fork 480
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 : introducing string conversion tools #24186
Comments
Commit: |
Changed keywords from none to unicode |
New commits:
|
Branch: u/chapoton/24186 |
comment:2
This is definitely the right direction. I'm not 100% sure how I feel about Rather than "string_to_..." I think it's more useful to have a set of four functions:
On Python 2 Similarly on Python 3 |
comment:3
More like I described here: #24059 comment:3 |
comment:4
That said these functions might be useful too, though I'm curious to see some examples of what you have in mind as to where they'd be useful. |
comment:5
If it helps clarify--the reason for my logic here is that the areas where it is most common to want to convert between bytes/unicode is at the boundary of system functions. On Python 2 the tradition here is " However on Python 3 things are very different--we still want, in most cases " If we want to write the same code on Python 2 and Python 3 we can write Of course there are exceptions to this case but they are less common. |
comment:6
And you really want to implement these in Cython, not plain Python. |
comment:7
Indeed--for example for the Python to |
comment:8
Replying to @embray:
...if it's a Something like
Ideally, that would be optimized away entirely in Python 2. This is not entirely true, because Cython still changes some refcounts. But the effect of that should be negligible. |
comment:9
Indeed since You could make it a |
comment:10
Are you going to propose a branch ? |
comment:11
Sure if you don't mind. |
comment:12
Of course I don't mind. I am asking for that since long. |
comment:13
Erik, will you do that or should I? One suggestion: I suggest to implement conversion |
comment:15
Do you mean as separate functions (I'm not sure how else one would do that)? |
comment:16
Replying to @embray:
I was thinking something like
|
comment:17
Okay, I have an implementation of this I'll post to a new ticket in a bit. I just want to try it out a bit in practice more. |
comment:18
Erik's implementation of |
comment:19
What is the point of this ticket in the light of #24222? Can we consider this a duplicate? |
comment:20
Replying to @jdemeyer:
I mean in fairness this came before #24222, which was my offer of an alternative. I think we can do without this for now. One thing I do like about it is that it supports conversion of Other than that though I don't think this ticket itself is needed. |
comment:21
then let us close this one as duplicate |
Reviewer: Frédéric Chapoton |
Changed author from Frédéric Chapoton to none |
CC: @embray @jdemeyer @tscrim @kiwifb
Component: python3
Keywords: unicode
Branch/Commit: u/chapoton/24186 @
0e6a9e5
Reviewer: Frédéric Chapoton
Issue created by migration from https://trac.sagemath.org/ticket/24186
The text was updated successfully, but these errors were encountered: