The offices of city attorney and judge, or judge pro tempore, of municipal court, shall be separate and distinct offices, and the judge, or judge pro tempore, of municipal court shall not be competent or eligible to hold the office of city attorney of the city during the term for which he or she was elected or selected.