Diablo 3's Smart Loot system only drops items usable by your current class, and only Legendaries allowed for your class. While 15% of world drops are non-Smart (so you have a chance of finding another class' Set item, for example), gambling with Kadala and crafting with Kanai's Cube always provide Smart Loot.
Speaking of Legendaries (and Sets, which are just another type of Legendaries, with no special handling), specific drop chances are determined by weights. After the game decides to drop a Legendary, say, Dagger, it adds up weights for all possible daggers allowed for current class, and picks a random number within that sum. Hence, items with higher weight are more likely to drop, but total number is also important.
Daggers Weight Classes
Eun-jang-do 50 Mo Ba Cr Wz WD
Kill 100 Mo Ba Cr Wz WD
Pig Sticker 100 Mo Ba Cr Wz WD
The Barber 100 Mo Ba Cr Wz WD
Wizardspike 50 Wz
Demon Hunters don't normally get daggers. Monks/Barbs/Crusaders/Doctors have a 50/350 = 14,28% chance to get an Eun-Jang-Do and 100/350 = 28,57% to get other daggers. Wizard's chance at those daggers, though, is less due to Wizardspike "stealing" some of the rolls, so chance for "common" daggers becomes 100/400 = 25%.
When gambling with Kadala or creating Legendaries with Kanai's Cube, you can only get legendaries allowed for your class. Obviously, if you cube an item that is not normally allowed for your class, the game will use other class's loot table, but never would a Barbarian get a Wizardspike this way. (I don't know if a Demon Hunter will have a chance at Wizardspike. Maybe, if proxy class is picked at random.)
Class-restricted legendaries are not limited to class sets. Each item type has one or more Legendaries that are only available for chosen classes. Consequently, drop chances for all items are slightly different for different classes, because of the weight principle described above. So, yes, class does affect drop rates of non-Set Legendaries.
Your specific example, the Magefist, is not class-restricted, but is rare - it has weight 50, half the "normal". Two classes with minimum Gloves weight sum - 700 - are Wizard and Demon Hunter, which gives them 1/14 or 7,14% chance to gamble for Magefist.
There are spreadhseets online with all the weights and drop chances. For version 2.3 the best is this list. It has upgrade costs and is easily searchable.
There is also another, probably older version that has largely the same data minus cube costs, but is not protected, so you can check all the formulas for yourself.