Imam al-Shafi'i (may Allah have mercy on him) said: "Allah, the Mighty and Majestic, says: 'And those of you who die and leave behind wives should make a bequest for their wives: provision for a year without turning them out (of the home); but if they leave (of their own accord), there is no sin upon you for what they do with themselves (in a recognized manner).' [Surah al-Baqarah: 240]"
Imam al-Shafi'i (may Allah have mercy on him) said: "I have preserved from more than one of the people of knowledge of the Qur'an that this verse was revealed before the revelation of the verses of inheritance and that it is abrogated, and that Allah Almighty made binding upon her (the widow) a waiting period of four months and ten days; she has no choice to leave it, nor to marry before it (ends)."
It is narrated from Ibn Abi Mulaykah that Sayyiduna Abdullah bin al-Zubayr (may Allah be pleased with them both) said: I said to Sayyiduna Uthman bin Affan (may Allah be pleased with him) that the verse 'And those of you who die and leave behind wives' [Surah al-Baqarah: 240] has been abrogated by the other verse, so why are you writing it, or why are you leaving it (in place)? He said: O son of my brother, I will not change anything of it from its place. And in the narration of Ali (bin al-Madini): Why do you write it when it has been abrogated by the other verse, 'And those of you who die and leave behind wives, they shall wait concerning themselves for four months and ten days' [Surah al-Baqarah: 234]?
Imam al-Bukhari (may Allah have mercy on him) narrated it in his Sahih from Umayyah bin Bistam.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب العدد / 15460