On Thu, Jul 21, 2011 at 6:58 AM, Xah Lee <xah...@gmail.com> wrote: > Thanks a lot for the fix Raymond.
That fix was from Thomas Jollans, not Raymond Hettinger. > Though, the code seems to have a minor problem. > It works, but the report is wrong. > e.g. output: > > 30068: c:/Users/h3/web/xahlee_org/p/time_machine\tm-ch04.html > > that 30068 position is the last char in the file. > The correct should be 28319. (or at least point somewhere in the file > at a bracket char that doesn't match.) Previously you wrote: > If a file has mismatched matching-pairs, the script will display the > file name, and the line number and column number of the first > instance where a mismatched bracket occures. (or, just the char number > instead (as in emacs's “point”)) I submit that as the file contains no mismatched brackets (only an orphan bracket), the output is correct to specification (indeed you did not define any output for this case), if not necessarily useful. In other words, stop being picky. You may be willing to spend an hour or moe on this, but that doesn't mean anybody else is. Raymond gave you a basically working Python solution, but forgot one detail. Thomas fixed that detail for you but didn't invest the time to rewrite somebody else's function to get the output "correct". Continuing to harp on it at this point is verging on trolling. -- http://mail.python.org/mailman/listinfo/python-list