On 06/27/2012 01:40 AM, Steven Schveighoffer wrote:
On Tue, 26 Jun 2012 19:10:25 -0400, bearophile
<bearophileh...@lycos.com> wrote:
Steven Schveighoffer:
I agree with Andrei, there is no outlet for errors in the to!T
function, exception is the logical choice.
Maybe I was not clear enough, so let me explain a bit better.
What I don't like is to!int("15\n") to be seen as an error in the
first place.
I'd like it to ignore leading and trailing whitespace, as in Python
(stripping it automatically):
Right, but what if it's an error in your code if whitespace is present?
Then you have to check for whitespace and throw your own error.
I admit, that would likely be a rare occasion. But having both behaviors
should be possible.
...
I think the default behaviour should be the behaviour that is wanted in
the majority of cases.