Taking a look at NumPy's setup.py I have noticed that at some point it includes something from NumPy's submodule numpy.distutils.
from numpy.distutils.core import numpy_cmdclass
I really cannot see how this can work, given that numpy.distutils – I think – should be part of the very same package it is trying to install. Wouldn't it be like if a package depends on itself to be installed? What's the working principle behind this? Why does this work?
I have noticed that it does the exact same thing, but from files that are actually part of the package. In this second case wouldn't it be better to use relative imports?