How to pass class instance to a method?

Dave Angel d at davea.name
Mon Nov 26 16:58:47 EST 2012


On 11/26/2012 03:51 PM, Ian Kelly wrote:
> On Mon, Nov 26, 2012 at 9:56 AM, Nobody <nobody at nowhere.com> wrote:
>> In a dynamically-typed language such as Python, the set of acceptable
>> types for an argument is determined by the operations which the function
>> performs on it. This is in direct contrast to a statically-typed language,
>> where the set of acceptable operations on an argument is determined by the
>> type of the argument.
> Not how I would put it.  In a statically typed language, types are
> checked at compile-time (which does not necessarily imply that useful
> type information can be made available to an IDE), whereas in a
> dynamically typed language, some or all type checking is deferred to
> run-time.

Not how I would put it.  In a statically typed language, the valid types
are directly implied by the function parameter declarations, while in a
dynamic language, they're defined in the documentation, and only
enforced (if at all) by the body of the function.


-- 

DaveA




More information about the Python-list mailing list