On 6/29/07, dailer <[EMAIL PROTECTED]> wrote:
...
> found my answer on comp.lang.python (these nested functions are a bit
> crazy)...

For this example:

def foo(msg1):
   def bar(msg2):
       print msg1, msg2
   return bar

if it helps, you can consider the parent declaration (foo) to be an
object (instance) without an explicit class declaration.

Also, naming generally helps.


def make_prefix(prefix):
   def finish_message(rest_of_message):
       print prefix, rest_of_message
   return finish_message

finish_laughing = make_prefix('haha')

Clearer?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to