On Sun, 09 Jan 2005 15:54:08 +1000, Nick Coghlan <[EMAIL PROTECTED]> wrote:
> Here's another nice one if 'where' is added to compound statements as well:
> 
> @dbc(pre, post)
> def foo():
>    pass
> where:
>    def pre():
>      pass
>    def post():
>      pass

Interesting. It solves some of the issues with chosing a clear syntax
for "design by contract" and other similar features that were being
debated lately. I also thought about his one:

! def foo(x=calculate_default_value()):
!     pass
! where:
!     def calculate_default_value():
!         ...
!         return <something>


-- 
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: [EMAIL PROTECTED]
mail: [EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to