You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.html
+50-22Lines changed: 50 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -1210,28 +1210,52 @@ <h4 id="functionscannotbevaluessotheymustbewrapped">Functions can not be values,
1210
1210
LogicOp = Enum(<spanclass="hljs-string">'LogicOp'</span>, {<spanclass="hljs-string">'AND'</span>: partial(<spanclass="hljs-keyword">lambda</span> l, r: l <spanclass="hljs-keyword">and</span> r),
1211
1211
<spanclass="hljs-string">'OR'</span> : partial(<spanclass="hljs-keyword">lambda</span> l, r: l <spanclass="hljs-keyword">or</span> r)})
1212
1212
</code></pre>
1213
+
<ul>
1214
+
<li><strong>Another solution in this particular case, is to use <codeclass="python hljs"><spanclass="hljs-string">'and_'</span></code> and <codeclass="python hljs"><spanclass="hljs-string">'or_'</span></code> functions from module <ahref="#operator">operator</a> as values.</strong></li>
<pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">raise</span> ValueError(<spanclass="hljs-string">'A very specific message!'</span>)
<pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">raise</span> ValueError(<spanclass="hljs-string">'Argument is of right type but inappropriate value!'</span>)
1252
+
<spanclass="hljs-keyword">raise</span> TypeError(<spanclass="hljs-string">'Argument is of wrong type!'</span>)
1253
+
<spanclass="hljs-keyword">raise</span> RuntimeError(<spanclass="hljs-string">'None of above!'</span>)
0 commit comments