code: def tech_requirement(self) -> Optional[UnitTypeId]:
          
          if self._proto.tech_requirement == 0:
              return None
          if self._proto.tech_requirement not in self._game_data.units:
              return None
          return UnitTypeId(self._proto.tech_requirement)
docs: Tech-building requirement of buildings - may work for units but unreliably