GH-101100: Fix reference warnings for ``__getitem__`` by AA-Turner · Pull Request #110118 · python/cpython
Do you have a rough idea of when it was working? (2010? 2015? 2020?) I could look at this, but unbounded I fear it'd be a fairly time consuming activity.
Prepending references with ~object. is a fairly easy mechanical task, though I appreciate it adds noise. From what I understand of Sphinx though, it does seem the 'proper' thing to do.
Perhaps of interest, this is a table of the frequency of dunder attributes that cause reference warnings (I've filtered a little but not properly):
| Count | Type | Target |
|---|---|---|
| 32 | meth | __exit__ |
| 31 | meth | __getitem__ |
| 26 | meth | __enter__ |
| 21 | meth | __get__ |
| 21 | meth | __init__ |
| 20 | meth | __iter__ |
| 20 | meth | __getattr__ |
| 20 | meth | __new__ |
| 16 | attr | __doc__ |
| 15 | meth | __getattribute__ |
| 13 | meth | __repr__ |
| 12 | attr | __cause__ |
| 12 | meth | __set__ |
| 12 | meth | __contains__ |
| 11 | attr | __annotations__ |
| 11 | meth | __hash__ |
| 10 | attr | __module__ |
| 10 | attr | __context__ |
| 10 | meth | __eq__ |
| 10 | meth | __len__ |
| 10 | attr | __self__ |
| 8 | meth | __reduce__ |
| 7 | meth | __str__ |
| 7 | meth | __add__ |
| 7 | attr | __func__ |
| 6 | attr | __traceback__ |
| 6 | meth | __delete__ |
| 6 | meth | __reversed__ |
| 6 | meth | __dir__ |
| 6 | meth | __lt__ |
| 6 | meth | __await__ |
| 6 | meth | __setstate__ |
| 6 | meth | __missing__ |
| 6 | meth | __setitem__ |
| 6 | meth | __index__ |
| 5 | meth | __set_name__ |
| 5 | meth | __radd__ |
| 5 | meth | __getstate__ |
| 5 | meth | __cmp__ |
| 4 | meth | __call__ |
| 4 | meth | __le__ |
| 4 | meth | __ge__ |
| 4 | meth | __format__ |
| 4 | meth | __delitem__ |
| 4 | meth | __int__ |
| 3 | attr | __suppress_context__ |
| 3 | attr | __members__ |
| 3 | meth | __getnewargs__ |
| 3 | attr | __wrapped__ |
| 3 | meth | __gt__ |
| 3 | meth | __setattr__ |
| 3 | meth | __or__ |
| 3 | attr | __code__ |
| 3 | meth | __ne__ |
| 3 | meth | __truediv__ |
| 3 | meth | __unicode__ |
| 2 | meth | __reduce_ex__ |
| 2 | attr | __isabstractmethod__ |
| 2 | meth | __and__ |
| 2 | attr | __notes__ |
| 2 | func | __getattr__ |
| 2 | attr | __defaults__ |
| 2 | attr | __globals__ |
| 2 | attr | __closure__ |
| 2 | attr | __type_params__ |
| 2 | meth | __floordiv__ |
| 2 | meth | __iadd__ |
| 2 | attr | __methods__ |
| 2 | meth | __coerce__ |
| 2 | meth | __complex__ |
| 2 | meth | __hex__ |
| 2 | meth | __oct__ |
| 2 | meth | __matmul__ |
| 1 | meth | __next__ |
| 1 | meth | __subclasscheck__ |
| 1 | meth | __aenter__ |
| 1 | meth | __aexit__ |
| 1 | meth | __abs__ |
| 1 | func | __getattribute__ |
| 1 | meth | __getnewargs_ex__ |
| 1 | meth | __bytes__ |
| 1 | meth | __fspath__ |
| 1 | attr | __kwdefaults__ |
| 1 | meth | __pow__ |
| 1 | meth | __neg__ |
| 1 | meth | __pos__ |
| 1 | meth | __invert__ |
| 1 | meth | __mul__ |
| 1 | meth | __rmul__ |
| 1 | meth | __mod__ |
| 1 | meth | __sub__ |
| 1 | meth | __lshift__ |
| 1 | meth | __rshift__ |
| 1 | meth | __rand__ |
| 1 | meth | __xor__ |
| 1 | meth | __rxor__ |
| 1 | meth | __ror__ |
| 1 | meth | __isub__ |
| 1 | attr | __metaclass__ |
| 1 | attr | __class__ |
| 1 | meth | __sizeof__ |
| 1 | data | __metaclass__ |
| 1 | meth | __getslice__ |
| 1 | meth | __setslice__ |
| 1 | meth | __delslice__ |
| 1 | func | __repr__ |
| 1 | func | __str__ |
| 1 | meth | __del__ |
| 1 | meth | __rmatmul__ |
| 1 | meth | __imatmul__ |
| 1 | meth | __rmod__ |
| 1 | meth | __divmod__ |
| 1 | meth | __aiter__ |
| 1 | attr | __all__ |
| 1 | meth | __class_getitem__ |
A