GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-113317: Argument Clinic: Add libclinic.converters module by vstinner · Pull Request #117315 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Mar 28, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

  • Issue: Argument Clinic: split out global stateless helpers and constants from clinic.py #113317

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
pythongh-113317, AC: Add libclinic.converters module
b1309b5
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.
@vstinner
vstinner requested a review from erlend-aasland as a code owner March 28, 2024 08:21
@bedevere-app bedevere-app Bot added the awaiting core review label Mar 28, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Mar 28, 2024
Argument Clinic: split out global stateless helpers and constants from clinic.py #113317
Closed
@erlend-aasland erlend-aasland added the skip news label Mar 28, 2024
@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
erlend-aasland
erlend-aasland reviewed Mar 28, 2024
View reviewed changes

@erlend-aasland erlend-aasland left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Tools/clinic/libclinic/__init__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

vstinner added 2 commits March 28, 2024 11:38
@vstinner
sort imports in libclinic/__init__.py
57eb77a
@vstinner
Update test_clinic
977dbbb
@vstinner

vstinner commented Apr 2, 2024

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland
erlend-aasland approved these changes Apr 2, 2024
View reviewed changes
Comment thread Tools/clinic/libclinic/converter.py Outdated
Comment on lines +540 to +542
"""
Adds a legacy converter.
"""

@erlend-aasland erlend-aasland Apr 2, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Tools/clinic/libclinic/converter.py Outdated
Comment on lines +537 to +538
format_unit: str,
**kwargs: Any

@erlend-aasland erlend-aasland Apr 2, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Apr 2, 2024
@vstinner
Address review
ff1f33d
@vstinner
vstinner enabled auto-merge (squash) April 2, 2024 09:54
@vstinner
vstinner merged commit 5fd1897 into python:main Apr 2, 2024
@vstinner
vstinner deleted the ac_converters branch April 2, 2024 10:09
@bedevere-app bedevere-app Bot removed the awaiting merge label Apr 2, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
@vstinner @diegorusso
pythongh-113317: Argument Clinic: Add libclinic.converters module (py…
a58e857
…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

Reviewers

@erlend-aasland erlend-aasland erlend-aasland approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@vstinner @erlend-aasland
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.