def path_glob(pattern, current_dir=None):
 if (not current_dir):
  current_dir = pathlib.Path.cwd()
 elif (not isinstance(current_dir, pathlib.Path)):
  current_dir = pathlib.Path(str(current_dir))
 for p in current_dir.glob(pattern):
  (yield Path(str(p)))

def path_glob ( pattern , current_dir = None ) : if ( not current_dir ) : current_dir = pathlib . Path . cwd ( ) elif ( not isinstance ( current_dir , pathlib . Path ) ) : current_dir = pathlib . Path ( str ( current_dir ) ) for p in current_dir . glob ( pattern ) : ( yield Path ( str ( p ) ) )
use pathlib for ant-like patterns .