Larry Bates napisaƂ(a):

> In python it is called duck typing but you don't need separate
> constructors:
> 
> def __init__(self, c):
>     if isinstance(c, int): ...do stuff...
>     elif isinstance(c, list): ...do stuff...
>     elif isinstance(c, tuple): ...do stuff...
>     else:
>     .
>     .
>     .
> 
> Remember Python doesn't care what c is and doesn't do
> type checking so you can do anything you want.

This is no better than type checking. And this doesn't remind "duck
typing" at all.

-- 
Jarek Zgoda
http://jpa.berlios.de/
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to