Is there a way (hopefully in Python) to make a unit which gets a bonus in attack or defence against any unit (short of writing out every unit name in the XML)?
Assuming anything without a combat type cannot attack or defend itself, this unit's strength won't matter--free win and cannot be attacked by units without a CT.
<Combat>NONE</Combat>
Is there a way (hopefully in Python) to make a unit which gets a bonus in attack or defence against any unit (short of writing out every unit name in the XML)?
I think you're reading way too much into Flying Pig's post. I would certainly look for an easier method than listing every unit in the XML and doesn't break when a modder adds new units. Seeking better ways of doing things is a commendable action IMHO. It's the spirit behind BUG.
I often find when interviewing candidates for software engineer roles that a leading indicator of a great engineer is a bit of laziness and a lot of willingness to do a lot of creating work up front to save repetitive work over time.
The first time I do a tedious task, I look for a better way, whether that be faster or more elegant or easier or whatever. If I don't find one, the next time I need to do that same tedious task, I make a better way. Chances are good that anything I've needed to do twice others will need to do as well.
I didn't think it could be done neatly in XML, and such problems are normally fixed by python.