תלמוד בבלי מסכת עירובין דף כז/א
אמר רבי יוחנן אין למידין מן הכללות ואפילו במקום שנאמר בו חוץ
Later authorities clarify the parameter of this principle, and many of the sources are cited by R' Yosef Engel in Gilyonei HaShas here. For example:
- This principle only applies when and where Chazal themselves applied it. Hence, we cannot apply it ourselves. Thus, Teshuvos Radbaz (2:652) states that he cannot apply any limitations to the generalization that a prophet can override the laws of the Torah on an ad hoc basis (hora'as sha'ah) other than the limitation stated by Chazal themselves, that it does not apply in cases of idolatry.
- This principle applies not only to generalizations that appear in mishnayos, but also to generalizations that appear in gemaros. Thus, Teshuvos Ri MiGash (§81) states that the Gemara's generalization that the law is in accordance with Rabban Shimon ben Gamliel in any mishnah in which he is cited excepted for three cases is not to be taken as definitive.
- This principle only applies to Talmudic sources. Thus, Teshuvos Chacham Tzvi (§55) states that it is not applicable to generalizations that appear in later Halachic works. Hence, we are permitted to extrapolate from the generalizations of the Poskim.