Yesterday I took some heat from the mouth-breathers for pointing out that Rashi, for all his talents, was not a marine biologist. (Can you read those words without hearing the voice of the George Costanza in your head? "The sea was angry that day my friends, like an old man trying to return soup at a deli." I can't.)
Having presented Rashi at his worst, I thought it would be appropriate today, to present Rashi at his best. Look at Exodus 2:23 "And it came to pass in the course of those many days that the king of Egypt died..." On this verse, Rashi says that despite what the verse itself tells us, the king didn't die, but became leprous. High school teachers across the land will tell you that Rashi's insight is based on the principle that "a leper is considered as dead” (Avodah Zarah 5a), but like most things high school teachers tell you, this view is nonsense.
Rashi's genius was spotting and resolving textual anomalies, and there are three anomalies surrounding Exodus 2:23 that must be addressed:
1 – It says the king died over a great many days, suggesting a prolonged condition. (Malbim)
2 – It says that after the king died, the children of Israel groaned. Odd, right? Why a groan and not a celebration? (Sifsei Chachamim)
3 - In Tanach, we’re never told that “a king died.” It’s always “Solomon died” or “David died.” Never the king. The fact that this verse refers to Pharoh as “the king od Egypt” suggest that he didn’t really die.
Rashi’s answer (it was leprosy, not death) is brilliant*. It addresses each of these irregularities, with the idea that a “lepor is considered as dead” justifying his solution to the textual maculations.
*Yes, Rashi's answer is based on a midrash, but Rashi's commentary sn't an anthology of midrashim. He cites some, ignores other, and sometimes even changes the midrash. The goal os his commentary on chumash is to solve textual problems; not to amuse us with midrashim.