New GitHub issue #119299 from skirpichev:<br>

<hr>

<pre>
# Bug report

### Bug description:

For the ``_decimal`` module we have Decimal's ``tp_name`` set to "decimal.Decimal", while for the ``_pydecimal`` version it's just "Decimal".  Same is true for other provided types.  Not sure that this affects many projects (from pure-python side I don't see differences due to this setting).  But here is a bugfix from gmpy2: https://github.com/aleaxit/gmpy/pull/483/commits/4a05610a4ad08b69330c70bc4ab29c669358a6a1

Maybe it worth to make these slots identical?  I doubt there is a way to change pure-Python version to C-version, but it's easy to do the opposite:
```diff
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c
index 2daa24c823..2d58e51fa3 100644
--- a/Modules/_decimal/_decimal.c
+++ b/Modules/_decimal/_decimal.c
@@ -5068,7 +5068,7 @@ static PyType_Slot dec_slots[] = {
 
 
 static PyType_Spec dec_spec = {
-    .name = "decimal.Decimal",
+    .name = "Decimal",
 .basicsize = sizeof(PyDecObject),
     .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
               Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_IMMUTABLETYPE),
```

As before, I don't see that this affects pure-Python code, using the decimal module.  Both ``__name__`` and ``__module__`` attributes are correct:
```pycon
>>> import _decimal
>>> import _pydecimal
>>> _decimal.Decimal.__module__
'decimal'
>>> _pydecimal.Decimal.__module__
'decimal'
>>> _pydecimal.Decimal.__name__
'Decimal'
>>> _decimal.Decimal.__name__
'Decimal'
```

### CPython versions tested on:

CPython main branch

### Operating systems tested on:

_No response_
</pre>

<hr>

<a href="https://github.com/python/cpython/issues/119299">View on GitHub</a>
<p>Labels: type-bug</p>
<p>Assignee: </p>