After the formal announcement Monday that Marissa Mayer had been elected the new CEO of Yahoo (Nasdaq: YHOO), the No. 3 search engine, the new executive announced she was pregnant.

Mayer, 37, tweeted the news late Monday. She and her spouse, Zachary Bogue, 44, the co-managing partner at Data Collective, are expecting a child in the second half.

Yahoo's board of directors, which now includes Mayer, wanted a health check of the new CEO, so this kind of information couldn't be hidden

But it calls to mind what happened with Carol Bartz, now 64, who served as Yahoo's CEO from 2009 until last September. She was the Sunnyvale, Calif., company's first woman CEO.

In 1992, though, while a senior executive at Sun Microsystems, then one of the high-flying workstation and software developers, Bartz, then 44, was recruited to be CEO of Autodesk (Nasdaq: ADSK), the San Rafael, Calif., developer of architectural design software.

Bartz, the mother of three, had a physical exam and notified the Autodesk directors she'd require surgery and treatment for breast cancer. She did and then served as Autodesk CEO for 14 years, then served as executive chairman.

Bartz was outspoken about breast cancer and the need for screening. She said she believed her forthrightness may have saved lives as well as encouraged male CEOs, especially Andrew S. Grove, then CEO of Intel (Nasdaq: INTC), the No. 1 chipmaker, to discuss his prostate cancer and also urge screening. She would ask journalists if they'd been checked for cancer lately.

Grove, now 75, remains one of Silicon Valley's luminaries as an Intel co-founder.

Bartz, while not running a company, is the lead independent director of Cisco Systems Inc. (Nasdaq: CSCO), in San Jose, Calif., the No. 1 provider of Internet gear.

Shares of Yahoo fell 15 cents to $15.50 in late Tuesday morning trading.