[PEAK] DecoratorTools will not run with python -OO

Christopher Stelma chris at digsby.com
Mon Dec 7 18:39:20 EST 2009


Certainly anything external that uses template_function() will still
not work, and in that case a warning would appropriate, but I see no
reason why that should preclude the remainder of DecoratorTools from
working under -OO.

For example, the call to synchronized() in
http://trac.turbogears.org/ticket/2426 would have succeeded if it's
internal wrap() had a manually assigned __doc__.

On Mon, Dec 7, 2009 at 5:43 PM, P.J. Eby <pje at telecommunity.com> wrote:
> At 05:19 PM 12/7/2009 -0500, Christopher Stelma wrote:
>>
>> That was just an example, the same would need to be done for all
>> template functions.  I haven't looked into the internals enough to
>> know what could be replaced.
>
> Every function in *every other library* that uses DecoratorTools' rewrap()
> function would have to be changed.  And rewrap() is part of the public API,
> as described here:
>
>  http://peak.telecommunity.com/DevCenter/DecoratorTools#signature-matching
>
> The best I think that can be done is change DecoratorTools to raise a better
> error in case of missing docstrings, and issue either a warning or an error
> when its own docstrings are missing.  In both cases, the message should
> mention that -OO removes docstrings and may not be compatible.
>
>
>



-- 
Christopher Stelma
Digsby Developer
chris at digsby.com


More information about the PEAK mailing list