An example:
def oldstyle(x):
if type(x) in (type(()), type([])):
for i in range(len(x)):
print i, x[i]
else:
print x
def newstyle(x):
if allowed(x[0]):
for i in range(len(x)):
print i, x[i]
else:
print x
This allowed() builtin would also obviate the need for the horrible
'type(x) in (type(0), type(0L), type(0.0), etc)' constructs, by
allowing you to ask 'allowed(x+1)'.
There's a potential implementation problem with allowed(), though,
depending on how syntax analysis/execution work. Hmpf, where is Guido
when you need him...
-- Jack Jansen | If I can't dance I don't want to be part of Jack.Jansen@cwi.nl | your revolution -- Emma Goldman uunet!cwi.nl!jack G=Jack;S=Jansen;O=cwi;PRMD=surf;ADMD=400net;C=nl