我在并行化new_text
unicode 类型的那部分代码时遇到了困难:
for old, new in self.replacements:
line = pywikibot.replaceExcept(
line, old, new, self.excsInside, self.site)
if new_text != entry.text:
yield pywikibot.Page(self.site, entry.title)
使用joblib或process-pool ,该任务看起来很容易,但是new_text
在循环之外使用了它。我不知道 or 的等价物#pragama omp ordered
,因为Python#pragma omp atomic
没有 OpenMP 包装器......
if
如果它并行运行,我如何确定 new_next 的值将在语句中是什么?