Re: Overloaded Functions

2008-07-29 Thread Daniel da Silva
With a little hacking, you might be able to do something like this: @overload("f", (int, int, str)) def f1(x, y, z): pass @overload("f", (str, str)) def f2(x, y): pass The way I would typically do method overloading would be as follows (this has been tested): class Person: def __in

Re: Overloaded Functions

2008-07-29 Thread Tim Henderson
Yes i am aware of that but I want the code to be self documenting, so the intent is clear. I actually have an implementation using that style which you suggest. I would like cleaner style, like the one i suggested in my first post. Cheers Tim Henderson -- http://mail.python.org/mailman/listinfo/py

Re: Overloaded Functions

2008-07-29 Thread Gary Herron
Tim Henderson wrote: Hi, So this may have been asked before but i haven't found the answer by googling so far. My situation is this: I want this structure for my code: @overloaded def sign_auth(secret, salt, auth_normalized): return __sign_auth(saltedhash_bin(secret, salt), auth_normalized