top | item 37059131 (no title) rep_movsd | 2 years ago Why is that array not const in the Cpython code? discuss order hn newest ynik|2 years ago Because every Python object also contains a reference count (which needs to be modified whenever the object is passed around), a `const PyObject*` is effectively useless. unknown|2 years ago [deleted] colejohnson66|2 years ago But we’re talking about an integer cache. It’s full of singletons; Why do they need to have reference counts? load replies (1) aflag|2 years ago That wouldn't make a difference in this case, would it? I suppose it would mean that the code would be UB, but in practice it'd just work the same.
ynik|2 years ago Because every Python object also contains a reference count (which needs to be modified whenever the object is passed around), a `const PyObject*` is effectively useless. unknown|2 years ago [deleted] colejohnson66|2 years ago But we’re talking about an integer cache. It’s full of singletons; Why do they need to have reference counts? load replies (1)
colejohnson66|2 years ago But we’re talking about an integer cache. It’s full of singletons; Why do they need to have reference counts? load replies (1)
aflag|2 years ago That wouldn't make a difference in this case, would it? I suppose it would mean that the code would be UB, but in practice it'd just work the same.
ynik|2 years ago
unknown|2 years ago
[deleted]
colejohnson66|2 years ago
aflag|2 years ago