4 ms·
The solution of adding the protection first is mentioned but there will be other situations later in which the use of a lot of self cannot be avoided, so it doe
by andreasvc 12y ago
The solution of adding the protection first is mentioned but there will be other situations later in which the use of a lot of self cannot be avoided, so it doesn't solve the general problem, if you call it that.
What is being called "defensive" I would rather call "permissive". If at all possible, I would prefer raising a ValueError if x1 >= x2.