Initializing with the correct type

Fredrik Lundh fredrik at pythonware.com
Thu Dec 7 09:37:08 EST 2006


aine_canby at yahoo.com wrote:

> I'm new to Python and I'm just wordering if my approch is correct.
> Here's an example. I'm making sure that the length and types are
> correct. This is in case I use such a class and accidently pass it the
> wrong object.

if you go with the language instead of against it, you'll soon find that if you
do accidentally pass in the wrong thing, you'll notice that pretty quickly:

    http://effbot.org/pytut/glossary#eafp
    http://effbot.org/pytut/glossary#duck-typing

</F> 






More information about the Python-list mailing list