why * is not like unquote (scheme)
mis6 at pitt.edu
Thu Mar 20 17:23:23 CET 2003
"Amir Hadar" <amir at clockwise3d.com> wrote in message news:<b5c8uj$s78$1 at news2.netvision.net.il>...
> I'me tring to create a factory function that create a class as follow:
> def CreatePreviewFrame(*addins):
> class tmp(cPreviewFrame,*addins):
> return tmp
> I checked a simpler case:
> 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")
> So why doesn't it work in all cases?
Do you know that type can be used as a class factory with the syntax
>>> def classfactory(name,*bases,**kw):
... return type(name,bases,kw)
Maybe this can help.
More information about the Python-list