Re: best way to create warning for obsolete functions and call new one

2012-03-28 Thread Gelonida N
Hi Dan, On 03/26/2012 11:24 PM, Dan Sommers wrote: On Mon, 26 Mar 2012 22:26:11 +0200 Gelonida N gelon...@gmail.com wrote: As these modules are used by quite some projects and as I do not want to force everybody to rename immediately I just want to warn users, that they call functions,

Re: best way to create warning for obsolete functions and call new one

2012-03-28 Thread Gelonida N
Hi Chris, On 03/26/2012 11:50 PM, Chris Angelico wrote: On Tue, Mar 27, 2012 at 7:26 AM, Gelonida N gelon...@gmail.com wrote: One option I though of would be: def obsolete_func(func): def call_old(*args, **kwargs): print func is old psl use new one return func(*args,

best way to create warning for obsolete functions and call new one

2012-03-26 Thread Gelonida N
Hi, I'm working on a module, which needs rather heavy renaming of functions and methods (naming style, change of functionality, understandability, orthography) As these modules are used by quite some projects and as I do not want to force everybody to rename immediately I just want to warn

Re: best way to create warning for obsolete functions and call new one

2012-03-26 Thread Dan Sommers
On Mon, 26 Mar 2012 22:26:11 +0200 Gelonida N gelon...@gmail.com wrote: As these modules are used by quite some projects and as I do not want to force everybody to rename immediately I just want to warn users, that they call functions, that have been renamed and that will be obsoleted. You

Re: best way to create warning for obsolete functions and call new one

2012-03-26 Thread Chris Angelico
On Tue, Mar 27, 2012 at 7:26 AM, Gelonida N gelon...@gmail.com wrote: One option I though of would be: def obsolete_func(func):    def call_old(*args, **kwargs):        print func is old psl use new one        return func(*args, **kwargs)    return call_old and def get_time(a='high'):