logoalt Hacker News

skydhashlast Thursday at 4:59 PM1 replyview on HN

If you’re talking about magic methods/properties enabled by reflection and macros, then you’re no longer statically analyzing the code.


Replies

everforwardlast Friday at 3:07 PM

Static analysis just requires that you don't actually execute the code. It's possible (sometimes) to infer what methods/properties would be create without actually statically analyzing the code.

E.g. mypy has a plugin to read the methods and return types of SQLAlchemy records, I believe without actually executing them.

Obviously not globally true, but in limited domains/scenarios you can see what would exist without actually executing the code.