Ibrahim said: Sayyiduna Ali and Sayyiduna Zaid (may Allah be pleased with them both) said: Slaves and People of the Book will neither deprive (others) nor will they inherit, and Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) said: They will indeed deprive (others) but will not inherit.
Brief Explanation
(Explanation of Hadiths 2930 to 2932)
For example, if a man passes away and leaves behind his mother who is either a slave (mamlukah) or a disbeliever (kafirah), and also leaves behind a grandmother, then according to the statement of Sayyiduna Ali and Sayyiduna Zayd radi Allahu anhuma, the mother will neither deprive the grandmother nor will she herself inherit; rather, the grandmother will receive her share from the inheritance.
And according to Sayyiduna Ibn Mas'ud radi Allahu anhu, in the presence of the mother—even if she is a disbeliever or a slave—the grandmother will be deprived, and the mother will not be an heir. And from Sayyiduna Ibn Mas'ud radi Allahu anhu, another statement is narrated that if any of the heirs, whether the mother or anyone else, is a slave (mamluk), then after being emancipated, they will be given their share from the inheritance.