在 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。