def add(song):
 if (not g.userhist.get('history')):
  g.userhist['history'] = Playlist('history')
 g.userhist['history'].songs.append(song)
 save()

def add ( song ) : if ( not g . userhist . get ( 'history' ) ) : g . userhist [ 'history' ] = Playlist ( 'history' ) g . userhist [ 'history' ] . songs . append ( song ) save ( )
convenience method will create a task and add it to a queue .