You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be nice if knows could key on something more specific than filename, since using knows on large files often isn't helpful.
Here's the additional information I can think of:
line numbers (as referenced in RFC: optimizations #2 (comment)). easy to get: settrace would have granularity inside functions, setprofile would only have the call/return.
function names. easy to get: frame.f_code.co_name
path above the function (eg package.module.Class.method). harder to get: I think you'd need to get a reference to the function and then the qualified name (which in 2.x may involve parsing the ast, which would be very slow).
Ideally, I'd want 2 + 3 so that keys would be qualified paths. This is about as specific as 1, but more robust to edits (since line numbers change often). But since I think 3 is too slow and 2 is not specific enough by itself (eg in the case of two methods of the same name inside different classes), I think 1+2 may be a good compromise.
Thoughts?
The text was updated successfully, but these errors were encountered:
I think in the short term (file, function_name) sounds like an already huge improvement over just file. Please send on over a pull request and I'll gladly review. If someone needs that granularity around specific lines changed and feels passionate about contributing it, it would be most welcome as well!
It'd be nice if knows could key on something more specific than filename, since using knows on large files often isn't helpful.
Here's the additional information I can think of:
frame.f_code.co_name
package.module.Class.method
). harder to get: I think you'd need to get a reference to the function and then the qualified name (which in 2.x may involve parsing the ast, which would be very slow).Ideally, I'd want 2 + 3 so that keys would be qualified paths. This is about as specific as 1, but more robust to edits (since line numbers change often). But since I think 3 is too slow and 2 is not specific enough by itself (eg in the case of two methods of the same name inside different classes), I think 1+2 may be a good compromise.
Thoughts?
The text was updated successfully, but these errors were encountered: