Typing system vs. Java

Courageous jkraska1 at san.rr.com
Sat Aug 4 14:40:49 EDT 2001


>> >>> mylist = [1,2,"alpha"]!
>> Type Consistency Error:
>> >>>

>Doesn't the array module already do this?

For numeric types with known type codes, yes. More
generally, no. For example, a common use of container
objects is to put instances of objects into them. A consitent
list would simply make certain that all objects in the list
were of the same type, perhaps using isinstance or some
such.

C//




More information about the Python-list mailing list