def debug_callback(event, *args, **kwds):
 l = [('event %s' % (event.type,))]
 if args:
  l.extend(map(str, args))
 if kwds:
  l.extend(sorted((('%s=%s' % t) for t in kwds.items())))
 print ('Debug callback (%s)' % ', '.join(l))

def debug_callback ( event , * args , ** kwds ) : l = [ ( 'event %s' % ( event . type , ) ) ] if args : l . extend ( map ( str , args ) ) if kwds : l . extend ( sorted ( ( ( '%s=%s' % t ) for t in kwds . items ( ) ) ) ) print ( 'Debug callback (%s)' % ', ' . join ( l ) )
example callback .