If every one of us be punished for his being happy upon his deed and for his being praised for what he has not done, nobody would be saved from the torment. Ibn 'Abbas said: What you have to do with this verse? It has been in fact revealed in connection with the people of the Book." Then Ibn Abbas recited this verse:" When Allah took a covenant from those who had been given the Book: You shall explain it to people and shall not conceal this" (iii. 186), and then Ibn 'Abbas recited this verse:" Think not that those who exult in what they have done and love to be praised for what they have not done" (iii. 186). Ibn 'Abbas (further) said: Allah's Apostle ( ﷺ) asked them about something and then they concealed that and they told him something else and they went out and they thought that they had informed him as lie had asked them and they felt happy of what they had concealed.
أَنْ يُحْمَدَ بِمَا لَمْ يَفْعَلْ مُعَذَّبًا لَنُعَذَّبَنَّ أَجْمَعُونَ فَقَالَ ابْنُ عَبَّاسٍ مَا لَكُمْ وَلِهَذِهِ الآيَةِ إِنَّمَا أُنْزِلَتْ هَذِهِ الآيَةُ فِي أَهْلِ الْكِتَابِ ثُمَّ تَلاَ ابْنُ عَبَّاسٍ { وَإِذْ أَخَذَ اللَّهُ مِيثَاقَ الَّذِينَ أُوتُوا الْكِتَابَ لَتُبَيِّنُنَّهُ لِلنَّاسِ وَلاَ تَكْتُمُونَهُ} هَذِهِ الآيَةَ وَتَلاَ ابْنُ عَبَّاسٍ { لاَ تَحْسَبَنَّ الَّذِينَ يَفْرَحُونَ بِمَا أَتَوْا وَيُحِبُّونَ أَنْ يُحْمَدُوا بِمَا لَمْ يَفْعَلُوا} وَقَالَ ابْنُ عَبَّاسٍ سَأَلَهُمُ النَّبِيُّ ﷺ عَنْ شَىْءٍ فَكَتَمُوهُ إِيَّاهُ وَأَخْبَرُوهُ بِغَيْرِهِ فَخَرَجُوا قَدْ أَرَوْهُ أَنْ قَدْ أَخْبَرُوهُ بِمَا سَأَلَهُمْ عَنْهُ وَاسْتَحْمَدُوا بِذَلِكَ إِلَيْهِ وَفَرِحُوا بِمَا أَتَوْا مِنْ كِتْمَانِهِمْ إِيَّاهُ مَا سَأَلَهُمْ عَنْهُ