In <[EMAIL PROTECTED]>, paul kölle
wrote:

> Marc 'BlackJack' Rintsch wrote:
>> In <[EMAIL PROTECTED]>, Yacao Wang
>> wrote:
>> 
>>> However, type signatures are not only a kind of information provided for
>>> the compiler, but also for the programmer, or more important, for the
>>> programmer. Without it, we have to "infer" the return type or required
>>> agument types of a function, and this can't be done without seeing the
>>> implementation of it,
>> 
>> That's what documentation is meant for.  If you are forced to look at the
>> implementation, the documentation is bad.
> I think the OP refers to reading the *code*, the documentation might not
> exist (yet).

It should be right there under the `def` as docstring.

> Sometimes I feel python is easier to write than to read and
>  missing argument type declarations (just for documentation purposes)
> are  IMHO one reason. Another are missing (optional) argument type
> checks at runtime. Something like WrongArgumentType exceptions instead
> of rather unspecific AttributeError from deep inside the code would be
> very convenient.

The you start getting `WrongArgumentType` exceptions sooner or later for
arguments that have all the necessary attributes in place but are of the
wrong "type".  Very inconvenient.

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to