On 2 nov, 14:54, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> Not necessarily. Something duck typing is too liberal in what it accepts.
> You might want convert(math.pi) to raise an exception

What I meant was that the function should not reject unnecessarily non-
numeric
things that can be converted to a number, like a string.  However,
you're right:
numeric things that are not integers should not be treated silently as
if they
were.

> although I'd suggestion an assert is the wrong test. A better test would be an
> explicit type check with raise.

I completely agree.

Cheers,
--
Roberto Bonvallet


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to