Re: [Pyobjc-dev] DeprecationWarning: Not all Objective-C arguments are present in the Python argume
Brought to you by:
ronaldoussoren
|
From: James R E. <ea...@cc...> - 2008-02-21 19:34:05
|
On Feb 21, 2008, at 04:40 , Ronald Oussoren wrote: > The DeprecationWarning is bogus here. What this is trying to > accomplish is warn about mismatches between the Python signature and > Objective-C signature of a method, but this is giving false > positives on some occassions. In your case you get the warning > because the decorated function has a variable number of arguments. Okay, that makes me feel a lot better. :-) Is there a way I can suppress the DeprecationWarning? It's not the end of the world if I can't, but I'd rather not dump those to the console when my app runs. The closest I've found is to use Michele Simionato's decorator module[1], which ensures that the wrapper generated by the decorator actually matches the wrapped function's signature (à la inspect.getargspec). I don't like this approach because it uses eval to generate the wrapper. I also haven't tested it to see if it successfully convinces PyObjC, but I assume it would. [1]: http://www.phyast.pitt.edu/~micheles/python/documentation.html Cheers! James -- "I'm using LaTeX math mode. How much more sexy can I be?" -- Je77 |