title: Limiting a number without a conditional
body: <p>Consider the following function:</p>
  <pre><code>def absolute_value(some_number):
      if some_number &lt; 0:
          return -some_number
  
      return some_number
  </code></pre>
  <p>and this one:</p>
  <pre><code>def absolute_value(some_number):
       return (some_number**2)**0.5
  </code></pre>
  <p>We can say that (in a naive manner) these two more or less achieve the same result (ignoring the performance issues) but the latter one has less cyclomatic complexity due to lack of the conditional. What I want is, for the sake of reduced cyclomatic complexity, I want to implement the following function without the conditional:</p>
  <pre><code>def limit(some_number):
      if some_number &gt; 1
          return 1
  
      return some_number
  </code></pre>
  <p>Is there an elegant way of doing this?</p>
  <p>Thank you for your interest.</p>