Every game- and engine-related object in Civ4--CyGame, CyPlayer, CyTeam, CyUnit, CyMap, CyPlot, CyInterface, CyEngine, CyMessageControl, and so on--lives in two worlds: in the SDK/DLL as C++ objects and in Python as, well, Python objects. All of the code in the .py files uses the
Python API.
Whenever you interact with a Python object, it is only a proxy (stand-in) for the "real" C++ object. A CyUnit is used in Python to operate on a CvUnit in C++. Most of the functions in the Python API exist as-is in C++, but there are many C++ functions that you cannot call via Python.
Every call to a Python object goes through a translation layer between the Python and C++ worlds, and again when the function returns back to Python. If you pass in "None" to a Python function, this translation layer turns it into NULL when calling the equivalent C++ function. This is handled automatically by the translation layer embedded in the game, called Boost (Boost:
ython in this case).
It is very similar to conversing with some in a foreign language via an interpreter. You say "book" to the interpreter, and they say "libro" to your conversation partner. Your partner says "verde", and the interpreter says "green."