Skip to content

Commit d8083ad

Browse files
Doc updates
1 parent c0da9c4 commit d8083ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/ql/src/Functions/IncorrectRaiseInSpecialMethod.qhelp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<overview>
66
<p>User-defined classes interact with the Python virtual machine via special methods (also called "magic methods").
77
For example, for a class to support addition it must implement the <code>__add__</code> and <code>__radd__</code> special methods.
8-
When the expression <code>a + b</code> is evaluated the Python virtual machine will call <code>type(a).__add__(a, b)</code> and if that
8+
When the expression <code>a + b</code> is evaluated, the Python virtual machine will call <code>type(a).__add__(a, b)</code>, and if that
99
is not implemented it will call <code>type(b).__radd__(b, a)</code>.</p>
1010
<p>
1111
Since the virtual machine calls these special methods for common expressions, users of the class will expect these operations to raise standard exceptions.
@@ -31,8 +31,8 @@ Therefore, if a method is unable to perform the expected operation then its resp
3131

3232
</overview>
3333
<recommendation>
34-
<p>If the method is intended to be abstract, and thus always raise an exception, then declare it so using the <code>@abstractmethod</code> decorator.
35-
Otherwise, either remove the method or ensure that the method raises an exception of the correct type.
34+
<p>If the method always raises as exception, then if it is intended to be an abstract method, the <code>@abstractmethod</code> decorator should be used.
35+
Otherwise, ensure that the method raises an exception of the correct type, or remove the method if the operation dos not need to be supported.
3636
</p>
3737

3838
</recommendation>

0 commit comments

Comments
 (0)