小编blu*_*gic的帖子

difflib.SequenceMatcher isjunk 参数不考虑?

在 python difflib 库中,SequenceMatcher 类的行为是否出乎意料,还是我误读了假定的行为?

为什么 isjunk 论点在这种情况下似乎没有任何区别?

difflib.SequenceMatcher(None, "AA", "A A").ratio() return 0.8

difflib.SequenceMatcher(lambda x: x in ' ', "AA", "A A").ratio() returns 0.8
Run Code Online (Sandbox Code Playgroud)

我的理解是,如果省略空格,则比率应为1。

python difflib sequencematcher

6
推荐指数
1
解决办法
1442
查看次数

标签 统计

difflib ×1

python ×1

sequencematcher ×1