def get_messages(request):
 return getattr(request, '_messages', [])

def get_messages ( request ) : return getattr ( request , '_messages' , [ ] )
returns the message storage on the request if it exists .