Skip to content
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

Add better string handling #1

Open
natezb opened this issue Feb 8, 2017 · 0 comments
Open

Add better string handling #1

natezb opened this issue Feb 8, 2017 · 0 comments
Assignees

Comments

@natezb
Copy link
Collaborator

natezb commented Feb 8, 2017

Currently, the 'buf'-related signature types are returned after being run through ffi.string(). This returns a bytes object (equivalent to str in Python 2). However, it'd be useful to have more control. There are probably 3 common cases:

  1. Always bytes
  2. Version-specific str (equivalent to bytes on py2, unicode on py3)
  3. Always unicode

We could introduce new names, e.g. strbuf, but that may be overly cluttered and annoying. A better solution may be to introduce a new flag for this setting, which will also allow us to do it on a per-library, per-object, and per-function level.

@natezb natezb self-assigned this Feb 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant