why * is not like unquote (scheme)

Amir Hadar amir at clockwise3d.com
Thu Mar 20 06:26:07 EST 2003


Hi

I'me tring to create a factory function that create a class as follow:

def CreatePreviewFrame(*addins):
    class tmp(cPreviewFrame,*addins):
        pass
    return tmp

I checked a simpler case:
(1,2,*(3,4))
and this is also syntax error.

but I can path parameters to a function as follow:

def f(a,b):
     print a,b

l = ("a","b")
f(*l)

So why doesn't it work in all cases?

Amir






More information about the Python-list mailing list