PEP 285: Adding a bool type

Donn Cave donn at u.washington.edu
Mon Apr 8 15:31:49 EDT 2002


Quoth Erik Max Francis <max at alcyone.com>:
| Jacob Hallen wrote:
|
| > I have been brought up in an environment which called anything
| > allowing mixed types in a list weakly typed.
| > 
| > If you prefer to call it dynamically typed, I don't mind.
|
| Weak typing usually refers to the idea that operations, not the objects
| themselves, decide as what types to manipulate objects.  Dynamic typing
| indicates that variables (or bindings) do not have an intrinsic type.

At best that seems confusing to me.  It would seem to say that
languages that use type inference would be weakly typed - they
sure let the operations decide object type.  In Objective Caml:

  # let oneup x = x + 1;;
  val oneup : int -> int = <fun>

  (i.e., because parameter x appears in the expression x + 1, x must
   have type int, and the function result must also be of type int.)

But Objective Caml's typing is hardly "weak" in any useful sense of
the word, rather it's quite rigorous.

| Python is strongly typed, since objects have intrinsic type, and those
| types are what determine how operations behave, rather than the reverse.

Maybe it would be best to just concede that these terms aren't useful.
I don't think I've ever seen anyone use them to shed any light on
Python programming, they're just occasions for academic quibbles that
have little to do with the substance of what people are saying.  Even
worse than "pass by reference" and "pass by value."

	Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list