osdir.com

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Functions unnecessarily called in Python/pylifecycle.c:_Py_InitializeCore() ?


Hello,

I was playing around with cpython and noticed the following. The
`_PyFrame_Init()` and `PyByteArray_Init()` functions are called in these
two locations:

	https://github.com/python/cpython/blob/master/Python/pylifecycle.c#L693-L694
	https://github.com/python/cpython/blob/master/Python/pylifecycle.c#L699-L700

But here are their function definitions and they appear to do nothing:

	https://github.com/python/cpython/blob/master/Objects/frameobject.c#L555-L561
	https://github.com/python/cpython/blob/master/Objects/bytearrayobject.c#L24-L28

I can understand leaving the functions in the source for
backwards-compatibility, but why are they still being called in
`_Py_InitializeCore()`? Seems like it just adds noise for those new to
the cpython internals. Is there some consistency doc that requires this
or something?

Maybe this isn't the right place to ask, but I'm not sure where is.
Thanks for any enlightenment!

Cheers,
Thomas