Re: accepts decorator

2006-09-26 Thread Gabriel Genellina
At Monday 25/9/2006 21:58, urielka wrote: i think i got what the * and ** mean. *args mean arguments that are assigned by position(that is why *arg is a tuple) **kwds mean arguments that are assigned using equals a=2,b=3 (that is why **kwds i a dict) but why self is in *args and other thing

Re: accepts decorator

2006-09-26 Thread urielka
hehe i saw that,that is what made my understand it. the decorator now works. let say i have a function decorated with two decorators: @Accept(int,int) @OtherDecorator def myfunc(a,b): pass how can i make the two decorators into one(note:one get parameters and the other doesn`t) --

accepts decorator

2006-09-25 Thread urielka
i want to make a decorator that make a function accept only types,if the types are wrong but the number of types is equal to arguments try to convert them to the type. for example: @Accept(int,int) def Sum(a,b): return a+b print Sum(2,2.0) this should print 4,coz the decorator sees that

Re: accepts decorator

2006-09-25 Thread urielka
i think i got what the * and ** mean. *args mean arguments that are assigned by position(that is why *arg is a tuple) **kwds mean arguments that are assigned using equals a=2,b=3 (that is why **kwds i a dict) but why self is in *args and other thing goes to **kwds? even if not assigned using