Suppose that I need some functionalities for my class(C) which are currently available in both  A and B classes. So I decided to inherit from A or B in my class (C). A is more complete and includes some additional methods and variables which I will never use them. However, I prefer to use A since it seems to make my code more unified in a joint project.
My question is that does inheritance from A, in comparison with B, affect the code speed or not?
In CPython, changing the class from which a class inherits has little or no impact on its speed so long as each method/attribute used comes from the corresponding class in the new hierarchy.  (The “little” case pertains when there are additional hash table collisions.)  Adding additional bases that must be searched (because they appear in the method resolution order before the class that satisfies a lookup) will add a dictionary lookup per attribute search.
For many __magic__ methods, no inheritance ever matters: the function to call for each is precalculated and resolved in constant time thereafter.
Effect of additional inheritance on execution speed