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

gh-113317: Argument Clinic: Add libclinic.converters module #117315

Merged
merged 4 commits into from Apr 2, 2024

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Mar 28, 2024

Move the following converter classes to libclinic.converters:

  • PyByteArrayObject_converter
  • PyBytesObject_converter
  • Py_UNICODE_converter
  • Py_buffer_converter
  • Py_complex_converter
  • Py_ssize_t_converter
  • bool_converter
  • byte_converter
  • char_converter
  • defining_class_converter
  • double_converter
  • fildes_converter
  • float_converter
  • int_converter
  • long_converter
  • long_long_converter
  • object_converter
  • self_converter
  • short_converter
  • size_t_converter
  • slice_index_converter
  • str_converter
  • unicode_converter
  • unsigned_char_converter
  • unsigned_int_converter
  • unsigned_long_converter
  • unsigned_long_long_converter
  • unsigned_short_converter

Move also the following classes to libclinic.converters:

  • buffer
  • robuffer
  • rwbuffer

Move the following functions to libclinic.converters:

  • correct_name_for_self()
  • r()
  • str_converter_key()

Move Null and NULL to libclinic.utils.

Move the following converter classes to libclinic.converters:

* PyByteArrayObject_converter
* PyBytesObject_converter
* Py_UNICODE_converter
* Py_buffer_converter
* Py_complex_converter
* Py_ssize_t_converter
* bool_converter
* byte_converter
* char_converter
* defining_class_converter
* double_converter
* fildes_converter
* float_converter
* int_converter
* long_converter
* long_long_converter
* object_converter
* self_converter
* short_converter
* size_t_converter
* slice_index_converter
* str_converter
* unicode_converter
* unsigned_char_converter
* unsigned_int_converter
* unsigned_long_converter
* unsigned_long_long_converter
* unsigned_short_converter

Move also the following classes to libclinic.converters:

* buffer
* robuffer
* rwbuffer

Move the following functions to libclinic.converters:

* correct_name_for_self()
* r()
* str_converter_key()

Move Null and NULL to libclinic.utils.
@erlend-aasland erlend-aasland changed the title gh-113317, AC: Add libclinic.converters module gh-113317: Argument Clinic: Add libclinic.converters module Mar 28, 2024
Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be a little bit confusing with both a converter.py and a converters.py in libclinic. Just sayin'; not a blocking issue.

Tools/clinic/libclinic/__init__.py Outdated Show resolved Hide resolved
@vstinner
Copy link
Member Author

vstinner commented Apr 2, 2024

@erlend-aasland: I updated the PR to fix test_clinic.

Comment on lines 540 to 542
"""
Adds a legacy converter.
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this useless docstring now that we're at it.

Comment on lines 537 to 538
format_unit: str,
**kwargs: Any
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you dedent these one level according to typing style conventions? I probably introduced this weird style, but this is a good opportunity to amend it.

@vstinner vstinner enabled auto-merge (squash) April 2, 2024 09:54
@vstinner vstinner merged commit 5fd1897 into python:main Apr 2, 2024
38 checks passed
@vstinner vstinner deleted the ac_converters branch April 2, 2024 10:09
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
…thon#117315)

Move the following converter classes to libclinic.converters:

* PyByteArrayObject_converter
* PyBytesObject_converter
* Py_UNICODE_converter
* Py_buffer_converter
* Py_complex_converter
* Py_ssize_t_converter
* bool_converter
* byte_converter
* char_converter
* defining_class_converter
* double_converter
* fildes_converter
* float_converter
* int_converter
* long_converter
* long_long_converter
* object_converter
* self_converter
* short_converter
* size_t_converter
* slice_index_converter
* str_converter
* unicode_converter
* unsigned_char_converter
* unsigned_int_converter
* unsigned_long_converter
* unsigned_long_long_converter
* unsigned_short_converter

Move also the following classes to libclinic.converters:

* buffer
* robuffer
* rwbuffer

Move the following functions to libclinic.converters:

* correct_name_for_self()
* r()
* str_converter_key()

Move Null and NULL to libclinic.utils.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants