need a temporary variable when using python generator... sigh...