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
Implement conversion C++ <-> str #23857
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Commit: |
New commits:
|
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:12
This is nice! How did you test the Python3 version? |
comment:13
Replying to @videlec:
To be honest, I did not. I am just hoping that it works. |
Reviewer: Vincent Delecroix |
Changed branch from u/jdemeyer/implement_cppstr___to_convert_any_c___object_to_str to |
In order to clean up the wrapping of C++ code, we need proper conversion of C++ objects to and from Python strings. This is currently done in a hacky way in
ccobject.h
but it can be done more cleanly using Cython's support for C++ templates.In particular, we implement:
ccrepr()
to convert any C++ object tostr
ccreadstr()
to convert astr
to a C++ objectWe intentionally use the words
repr
andread
because this is using string input/output (operators<<
and>>
).Moreover, this new function will support both Python 2 and Python 3. In the latter case, the filesystem encoding is used.
CC: @embray
Component: python3
Author: Jeroen Demeyer
Branch/Commit:
b7127ce
Reviewer: Vincent Delecroix
Issue created by migration from https://trac.sagemath.org/ticket/23857
The text was updated successfully, but these errors were encountered: