Typing system vs. Java
Courageous
jkraska1 at san.rr.com
Sat Aug 4 16:09:02 EDT 2001
>Would you use it often enough to warrant a language change?
Personally, probably not. I'm really only observing that many of
the requests for "type safe containers" that you see around are
really on a desire to have uniform containers. It's easy enough
to create these by hand if your really want them.
>OTOH, if '!' were a unary postfix operator that you could define ... ;-)
>
>def __operator__!(mylist):
> return type(mylist) in (type(()),type([])) and \
> len([x for x in mylist if type(x)!=type(mylist[0])])==0)
That would be kind of cool.
C//
More information about the Python-list
mailing list