Skip to content

Python: Port HashedButNoHash.ql#21686

Draft
tausbn wants to merge 2 commits intomainfrom
tausbn/python-port-hashed-but-no-hash
Draft

Python: Port HashedButNoHash.ql#21686
tausbn wants to merge 2 commits intomainfrom
tausbn/python-port-hashed-but-no-hash

Conversation

@tausbn
Copy link
Copy Markdown
Contributor

@tausbn tausbn commented Apr 9, 2026

This one is a bit more involved. Of note is the fact that it at present only uses local flow when determining the origin of some value (whereas the points-to version used global flow). It may be desirable to rewrite this query to use global data-flow, but this should be done with some care (as using "all unhashable objects" as the set of sources is somewhat iffy with respect to performance). For that reason, I'm sticking to mostly local flow (except for well behaved things like types and built-ins).

This one is a bit more involved. Of note is the fact that it at present
only uses local flow when determining the origin of some value (whereas
the points-to version used global flow). It may be desirable to rewrite
this query to use global data-flow, but this should be done with some
care (as using "all unhashable objects" as the set of sources is
somewhat iffy with respect to performance). For that reason, I'm
sticking to mostly local flow (except for well behaved things like types
and built-ins).
@tausbn tausbn added the no-change-note-required This PR does not need a change note label Apr 9, 2026
@github-actions github-actions bot added the Python label Apr 9, 2026
Two main variants: cases where `__eq__` is not defined (which inherit
`__hash__` automatically), and frozen dataclasses.
@tausbn tausbn force-pushed the tausbn/python-port-hashed-but-no-hash branch from 802ee02 to a7ba98c Compare April 9, 2026 21:35
@@ -0,0 +1 @@
Expressions/HashedButNoHash.ql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-required This PR does not need a change note Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants