On Sat, 09 Feb 2013 14:35:33 +0000, Thomas Scrace <t...@scrace.org> wrote:
> R. David Murray <rdmurray <at> bitdance.com> writes:
> 
> > The reason we avoid such type checks is that we prefer to operate via
> > "duck typing", which means that if an object behaves like the expected
> > input, it is accepted.  Here, if we did an explicit type check for str,
> > it would prevent join from working on an "act alike" object that had
> > just enough str like methods to work correctly in os.join (for example,
> > some specialized object that was among other things a filename proxy).
> 
> I see, that makes sense. Thanks. I guess this actually goes to the heart of 
> the 
> flexibility of dynamic/weakly-typed languages. If we wanted to strictly 
> enforce 
> the type of a function's arguments we would use a strong type system.

No, it is more the difference between *statically* typed and dynamically
typed.  Python is a strongly typed language (every object has a specific
type).

--David
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to