<p dir="ltr"><br>
On Feb 12, 2014 9:16 PM, "Steven D'Aprano" <<a href="mailto:steve@pearwood.info">steve@pearwood.info</a>> wrote:<br>
><br>
> On Tue, 11 Feb 2014 07:36:34 -0800, Travis Griggs wrote:<br>
><br>
> > On Feb 10, 2014, at 10:30 PM, Steven D'Aprano <<a href="mailto:steve@pearwood.info">steve@pearwood.info</a>><br>
> > wrote:<br>
> ><br>
> ><br>
> >>>    1. Parenthesis should not be required for parameter- less<br>
> >>>    functions.<br>
> >><br>
> >> Of course they should. Firstly, parameter-less functions are a code-<br>
> >> smell, and ought to be discouraged. Secondly, even if you have a good<br>
> >> reason for using one -- for example, random.random -- then the<br>
> >> difference between referring to the object and calling the object<br>
> >> should be clear.<br>
> ><br>
> > Interesting. Can you clarify or provide some links to the<br>
> > "parameter-less functions are a code-smell” bit?<br>
><br>
><br>
> Functions map a value to another value. They can be one-to-one, or many-<br>
> to-one. (Mathematically, they cannot be one-to-many or many-to-many,<br>
> that's called a relation.) What about zero-to-one?<br>
><br>
> If the function always returns the same result, e.g.:<br>
><br>
> def spam():<br>
>     return "spam spam spam"</p>
<p dir="ltr">That's still one-to-one. There is no such thing as a zero-to-one mapping.</p>
<p dir="ltr">Mathematical functions map a single value to a single value. To represent multi-argument functions then, the single input takes on the value of an ordered sequence. The input value of a 0-argument function then is the empty sequence.<br>

</p>