pytorch/pytorch

Standardize slot handler naming in `torch/_dynamo`

Open

#190,841 opened on Jul 23, 2026

 (4 comments) (0 reactions) (0 assignees)Python (28,701 forks)batch import
bot-triagedenhancementgood first issuemodule: dynamooncall: pt2triaged

Repository metrics

Stars
 (102,165 stars)
PR merge metrics
 (Avg merge 1d 10h) (42 merged PRs in 30d)

Description

Following https://github.com/pytorch/pytorch/issues/190702, we would like to standardize the slots functions to follow a specific naming convention as well. I did a little research and I think a good naming convention would be <family>_<slot_name>_impl.

The methods that needs to be updated are:

Field Current New
nb_bool bool_impl nb_bool_impl
sq_length sq_length sq_length_impl
sq_contains sq_contains sq_contains_impl
mp_length mp_length mp_length_impl
tp_repr repr_impl tp_repr_impl
tp_str str_impl tp_str_impl
tp_getattro getattro_impl tp_getattro_impl
tp_setattro setattro_impl tp_setattro_impl
tp_richcompare richcompare_impl tp_richcompare_impl

cc @chauhang @penguinwu @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @kadeng @amjames @jataylo @azahed98

Contributor guide