New GitHub issue #101266 from ionite34:<br>
<hr>
<pre>
# Bug report
Most built-in types, when subclassed, will have a `__sizeof__` that is 8 (pointer size) larger than the parent object, due to having an instance dictionary.
```python
class UserFloat(float): pass
assert UserFloat().__sizeof__() - (0.0).__sizeof__() == 8
class UserTuple(tuple): pass
assert UserTuple().__sizeof__() - ().__sizeof__() == 8
class UserList(list): pass
assert UserList().__sizeof__() - [].__sizeof__() == 8
class UserDict(dict): pass
assert UserDict().__sizeof__() - {}.__sizeof__() == 8
```
This is unexpectedly, not the case for `int` and `set`, which exactly match the original `__sizeof__`
```python
class UserSet(set): pass
print(UserSet().__sizeof__(), set().__sizeof__()) # 200 200
class UserInt(int): pass
print(UserInt().__sizeof__(), (0).__sizeof__()) # 24 24
```
# Your environment
- CPython versions tested on: 3.11, 3.12.0a3
</pre>
<hr>
<a href="https://github.com/python/cpython/issues/101266">View on GitHub</a>
<p>Labels: type-bug</p>
<p>Assignee: </p>