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

[WIP] gh-85283: Build _csv extension with limited C API #117321

Closed
wants to merge 1 commit into from

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Mar 28, 2024

  • Replace PyObject_VectorcallDict() with PyObject_Call() in _call_dialect(). Create a temporary tuple to pass the positional dialect argument.
  • Use PyUnicode_DecodeUTF32() to create an Unicode string from Py_UCS4 characters.
  • Replace PyErr_Format("%.200s", Py_TYPE(src)->tp_name) with PyErr_Format("%T", src).
  • Replace PyUnicode_READ_CHAR() with PyUnicode_ReadChar().
  • Replace PyUnicode_READ() with PyUnicode_ReadChar(). join_append_lineterminator() now takes an object (Unicode string) as argument.
  • Replace PyUnicode_GET_LENGTH() with PyUnicode_GetLength().
  • Replace Py_XSETREF() with assignement and Py_XDECREF().
  • Replace PyDict_Pop() with PyDict_DelItem().
  • Use PyType_GetSlot() to get tp_clear and tp_alloc slots.
  • Add some casts to (PyObject*).
  • Add an explicit #include <string.h>.

* Replace PyObject_VectorcallDict() with PyObject_Call() in
  _call_dialect(). Create a temporary tuple to pass the positional
  dialect argument.
* Use PyUnicode_DecodeUTF32() to create an Unicode string from
  Py_UCS4 characters.
* Replace PyErr_Format("%.200s", Py_TYPE(src)->tp_name) with
  PyErr_Format("%T", src).
* Replace PyUnicode_READ_CHAR() with PyUnicode_ReadChar().
* Replace PyUnicode_READ() with PyUnicode_ReadChar().
  join_append_lineterminator() now takes an object (Unicode string)
  as argument.
* Replace PyUnicode_GET_LENGTH() with PyUnicode_GetLength().
* Replace Py_XSETREF() with assignement and Py_XDECREF().
* Replace PyDict_Pop() with PyDict_DelItem().
* Use PyType_GetSlot() to get tp_clear and tp_alloc slots.
* Add some casts to (PyObject*).
* Add an explicit #include <string.h>.
@vstinner
Copy link
Member Author

vstinner commented Apr 3, 2024

I don't think that it's worth it. I prefer to close this PR.

@vstinner vstinner closed this Apr 3, 2024
@vstinner vstinner deleted the limited_csv branch April 3, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant