pdb.Pdb.find_function method is not able to recognize class methods, since the regular expression it uses only looks for "def" at beginning of lines. Please replace r'def\s+%s\s*[(]' % funcname with r'\s*def\s+%s\s*[(]' % funcname test file in attachment. this file shows that pdb can set a breakpoint on foo but not on readline function. Regards, Emmanuel www.e-rsatz.info
I think it's a bit more complicated than it seems: it's more than common for different classes to have methods with the same name. So looking for "\s*def func" will just grab the first matching method...Which is probably not what one would want...And dealing with multiple matches might be more hassle than it's worth.. So maybe the current behaviour should be kept as is NOTE: you CAN currently set breakpoints in methods by doing b Class.method