On Tuesday 08 March 2005 18:05, Jim Jewett wrote:
... compiler recognition of @deprecated in doc comments.
Michael Chermside suggested:
= code =
import warnings
def deprecated(func):
This is a decorator which can be used to mark functions
as
This is a recipe for disaster. Creating a new function from the old can have
unwanted side effects, since you effectively change the object. For example,
if someone is monkey patching this function, then the deprecation warning
gets lost.
That's a rather extreme use case, and not one that IMO
Greg wished for:
... compiler recognition of @deprecated in doc comments.
Michael Chermside suggested:
= code =
import warnings
def deprecated(func):
This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being
Michael Chermside suggested:
import warnings
def deprecated(func):
This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emmitted
when the function is used.
def newFunc(*args, **kwargs):