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-111178: remove redundant casts for functions with correct signatures by picnixz · Pull Request #131673 · python/cpython

gh-111178: remove redundant casts for functions with correct signatures #131673

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.

Sign up for GitHub

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

Merged
picnixz merged 24 commits into python:main from picnixz:fix/ubsan/casts-111178
Apr 1, 2025

Uh oh!

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

Merged

gh-111178: remove redundant casts for functions with correct signatures #131673

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
70861ec
remove un-necessary casts to PyCFunction
picnixz Feb 6, 2025
d356465
remove un-necessary casts to `getter`
picnixz Feb 6, 2025
f641773
remove un-necessary casts to `setter`
picnixz Feb 6, 2025
a197210
remove un-necessary casts for `initproc`
picnixz Mar 20, 2025
5a39cb7
add TODO note to remove casts to `destructor`
picnixz Mar 20, 2025
222b662
un-necessary cast for module free functions
picnixz Mar 20, 2025
ad434c0
fixup: None and NoneType
picnixz Mar 20, 2025
2fea60f
fixup: _PyDictViewObject
picnixz Mar 20, 2025
47bc0ee
fixup: bool_invert
picnixz Mar 20, 2025
a894c4c
fixup: PyUnicodeObject methods
picnixz Mar 20, 2025
1c17bfc
fixup: rangeobject
picnixz Mar 20, 2025
e415739
fixup: zoneinfo_init_subclass
picnixz Mar 20, 2025
86bc47c
fixup: ga_iter
picnixz Mar 24, 2025
5d98a84
fixup: hamt_baseiter_tp_iternext
picnixz Mar 24, 2025
1053101
remove dead code
picnixz Mar 24, 2025
5e68e29
Merge branch 'main' into fix/ubsan/casts-111178
picnixz Mar 24, 2025
937aa63
Merge branch 'main' into fix/ubsan/casts-111178
picnixz Mar 24, 2025
9c780ad
Update Include/cpython/object.h
picnixz Mar 24, 2025
3124512
Merge remote-tracking branch 'upstream/main' into fix/ubsan/casts-111178
picnixz Mar 30, 2025
92d648e
fixup comments
picnixz Mar 30, 2025
25c2a3f
Merge branch 'main' into fix/ubsan/casts-111178
picnixz Mar 31, 2025
4bf2a1e
Update Modules/faulthandler.c
picnixz Apr 1, 2025
db5dae1
Update Include/cpython/object.h
picnixz Apr 1, 2025
6cfed6c
Update Python/ceval.c
picnixz Apr 1, 2025
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

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

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

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

Diff view
Diff view
Prev Previous commit
Next Next commit
remove un-necessary casts to setter
  • Loading branch information

Uh oh!

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

@picnixz
picnixz committed Mar 24, 2025
commit f641773ae89b2afec622ec2ea483a024088e879d

There are no files selected for viewing

2 changes: 1 addition & 1 deletion 2 Modules/_functoolsmodule.c
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,7 @@ _functools__lru_cache_wrapper_cache_clear_impl(PyObject *self)
}

static PyObject *
lru_cache_reduce(PyObject *self, PyObject *Py_UNUSED(ignored))
lru_cache_reduce(PyObject *self, PyObject *Py_UNUSED(dummy))
{
return PyObject_GetAttrString(self, "__qualname__");
}
Expand Down
8 changes: 4 additions & 4 deletions 8 Modules/_testcapi/watchers.c
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ _testcapi_unwatch_dict_impl(PyObject *module, int watcher_id, PyObject *dict)
}

static PyObject *
get_dict_watcher_events(PyObject *self, PyObject *Py_UNUSED(ignored))
get_dict_watcher_events(PyObject *self, PyObject *Py_UNUSED(args))
{
if (!g_dict_watch_events) {
PyErr_SetString(PyExc_RuntimeError, "no watchers active");
Expand Down Expand Up @@ -255,7 +255,7 @@ clear_type_watcher(PyObject *self, PyObject *watcher_id)
}

static PyObject *
get_type_modified_events(PyObject *self, PyObject *Py_UNUSED(ignored))
get_type_modified_events(PyObject *self, PyObject *Py_UNUSED(args))
{
if (!g_type_modified_events) {
PyErr_SetString(PyExc_RuntimeError, "no watchers active");
Expand Down Expand Up @@ -413,7 +413,7 @@ get_code_watcher_num_destroyed_events(PyObject *self, PyObject *watcher_id)
}

static PyObject *
allocate_too_many_code_watchers(PyObject *self, PyObject *Py_UNUSED(ignored))
allocate_too_many_code_watchers(PyObject *self, PyObject *Py_UNUSED(args))
{
int watcher_ids[CODE_MAX_WATCHERS + 1];
int num_watchers = 0;
Expand Down Expand Up @@ -742,7 +742,7 @@ get_context_switches(PyObject *Py_UNUSED(self), PyObject *watcher_id)
}

static PyObject *
allocate_too_many_context_watchers(PyObject *self, PyObject *Py_UNUSED(ignored))
allocate_too_many_context_watchers(PyObject *self, PyObject *Py_UNUSED(args))
{
int watcher_ids[CONTEXT_MAX_WATCHERS + 1];
int num_watchers = 0;
Expand Down
6 changes: 3 additions & 3 deletions 6 Modules/atexitmodule.c
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Run all registered exit functions.\n\
If a callback raises an exception, it is logged with sys.unraisablehook.");

static PyObject *
atexit_run_exitfuncs(PyObject *module, PyObject *Py_UNUSED(ignored))
atexit_run_exitfuncs(PyObject *module, PyObject *Py_UNUSED(dummy))
{
struct atexit_state *state = get_atexit_state();
atexit_callfuncs(state);
Expand All @@ -231,7 +231,7 @@ PyDoc_STRVAR(atexit_clear__doc__,
Clear the list of previously registered exit functions.");

static PyObject *
atexit_clear(PyObject *module, PyObject *Py_UNUSED(ignored))
atexit_clear(PyObject *module, PyObject *Py_UNUSED(dummy))
{
atexit_cleanup(get_atexit_state());
Py_RETURN_NONE;
Expand All @@ -244,7 +244,7 @@ PyDoc_STRVAR(atexit_ncallbacks__doc__,
Return the number of registered exit functions.");

static PyObject *
atexit_ncallbacks(PyObject *module, PyObject *Py_UNUSED(ignored))
atexit_ncallbacks(PyObject *module, PyObject *Py_UNUSED(dummy))
{
struct atexit_state *state = get_atexit_state();
assert(state->callbacks != NULL);
Expand Down
4 changes: 2 additions & 2 deletions 4 Modules/faulthandler.c
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1124,8 +1124,8 @@ faulthandler_fatal_error_c_thread(PyObject *self, PyObject *args)
Py_RETURN_NONE;
}

static PyObject* _Py_NO_SANITIZE_UNDEFINED
faulthandler_sigfpe(PyObject *self, PyObject *Py_UNUSED(ignored))
static PyObject * _Py_NO_SANITIZE_UNDEFINED
Comment thread
picnixz marked this conversation as resolved.
Resolved

Uh oh!

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

faulthandler_sigfpe(PyObject *self, PyObject *Py_UNUSED(dummy))
{
faulthandler_suppress_crash_report();

Expand Down
2 changes: 1 addition & 1 deletion 2 Objects/dictobject.c
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -5922,7 +5922,7 @@ dictview_mapping(PyObject *view, void *Py_UNUSED(ignored)) {
}

static PyGetSetDef dictview_getset[] = {
{"mapping", dictview_mapping, (setter)NULL,
{"mapping", dictview_mapping, NULL,
PyDoc_STR("dictionary that this view refers to"), NULL},
{0}
};
Expand Down
4 changes: 2 additions & 2 deletions 4 Objects/genericaliasobject.c
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -824,8 +824,8 @@ ga_unpacked_tuple_args(PyObject *self, void *unused)
}

static PyGetSetDef ga_properties[] = {
{"__parameters__", ga_parameters, (setter)NULL, PyDoc_STR("Type variables in the GenericAlias."), NULL},
{"__typing_unpacked_tuple_args__", ga_unpacked_tuple_args, (setter)NULL, NULL},
{"__parameters__", ga_parameters, NULL, PyDoc_STR("Type variables in the GenericAlias."), NULL},
{"__typing_unpacked_tuple_args__", ga_unpacked_tuple_args, NULL, NULL},
{0}
};

Expand Down
8 changes: 4 additions & 4 deletions 8 Objects/longobject.c
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -6540,19 +6540,19 @@ static PyMethodDef long_methods[] = {

static PyGetSetDef long_getset[] = {
{"real",
long_long_getter, (setter)NULL,
long_long_getter, NULL,
"the real part of a complex number",
NULL},
{"imag",
long_get0, (setter)NULL,
long_get0, NULL,
"the imaginary part of a complex number",
NULL},
{"numerator",
long_long_getter, (setter)NULL,
long_long_getter, NULL,
"the numerator of a rational number in lowest terms",
NULL},
{"denominator",
long_get1, (setter)NULL,
long_get1, NULL,
"the denominator of a rational number in lowest terms",
NULL},
{NULL} /* Sentinel */
Expand Down
2 changes: 1 addition & 1 deletion 2 Objects/unionobject.c
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ static PyGetSetDef union_properties[] = {
PyDoc_STR("Qualified name of the type"), NULL},
{"__origin__", union_origin, NULL,
PyDoc_STR("Always returns the type"), NULL},
{"__parameters__", union_parameters, (setter)NULL,
{"__parameters__", union_parameters, NULL,
PyDoc_STR("Type variables in the types.UnionType."), NULL},
{0}
};
Expand Down
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 01402520 — 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.