On Thu, Jan 29, 2015, at 10:56, Steven D'Aprano wrote: > Bar language, on the other hand, tries extremely hard to ensure that > every > type is automatically able to be coerced into every other type. The > coercion might not do what you expect, but it will do *something*:
See, this is where the concept falls apart. Many people will define a dynamically-typed language as weakly-typed *only if* the result of the automatic type coercion is unexpected/distasteful/fattening, even if it is well-defined and predictable according to the rules of the language. Which makes it a matter of personal taste. > Bar will never give you a TypeError. I think we can agree that Bar is a > *very weakly typed* language. Statically typed lanugages by definition can never give you a TypeError - there are no runtime conversions that can succeed or fail based on the type of the arguments. What makes a statically typed language strong or weak? Are statically typed languages always weak? > > There are degrees of strength, and I think that Python comes closer to > the > Foo end than the Bar end. There are few automatic coercions, and most of > those are in the numeric tower according to the usual mathematical rules. Why is converting an int to a float when passed to a math function better than converting any object to a string when passed to a string function? -- https://mail.python.org/mailman/listinfo/python-list