At 09:58 PM 5/8/2007 -0400, Chris Monson wrote: >If we are looking at doing Design By Contract using @before and >@after (preconditions and postconditions), shouldn't there be some >way of getting at the return value in functions decorated with @after?
Actually, it isn't really design by contract; i.e., I wasn't using the word "postconditions" in the DBC sense. I was saying you could put code there to *ensure* (i.e. implement) additional postconditions, not *check* them. If you wanted to implement DBC, it might be simplest to subclass overloading.Around to create a Contract class and @contract decorator, with a higher method-combination precedence than Around methods. Indeed, that might make another nice example for the PEP. _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
