Messenger of Allah ﷺ used to leave fasting in a certain month till we thought that he would not fast in that month, and he used to fast in another month till we thought he would not stop fasting at all in that month. And if one wanted to see him praying at night, one could see him (in that condition), and if one wanted to see him sleeping at night, one could see him (in that condition) too.
أَنَّهُ سَمِعَ أَنَسًا ؓ يَقُولُ كَانَ رَسُولُ اللَّهِ ﷺ يُفْطِرُ مِنَ الشَّهْرِ حَتَّى نَظُنَّ أَنْ لاَ يَصُومَ مِنْهُ وَيَصُومُ حَتَّى نَظُنَّ أَنْ لاَ يُفْطِرَ مِنْهُ شَيْئًا وَكَانَ لاَ تَشَاءُ تَرَاهُ مِنَ اللَّيْلِ مُصَلِّيًا إِلاَّ رَأَيْتَهُ وَلاَ نَائِمًا إِلاَّ رَأَيْتَهُ وَقَالَ سُلَيْمَانُ عَنْ حُمَيْدٍ أَنَّهُ سَأَلَ أَنَسًا فِي الصَّوْمِ