4 ms·
Writing a literal parser isn’t too hard (and there’s presumably an existing one in the source code for the language). Writing something that understands all th
by everforward 7mo ago
Writing a literal parser isn’t too hard (and there’s presumably an existing one in the source code for the language).
Writing something that understands all the methods that come in a Django model goes way beyond parsing the code, and is a genuine struggle in language where you can’t execute the code without worrying about side effects like Python.
Ty should give them a base for that where the model is able to see things that aren’t literally in the code and aren’t in the training data (eg an internal version of something like SQLAlchemy).
- skydhash 7mo agoIf you’re talking about magic methods/properties enabled by reflection and macros, then you’re no longer statically analyzing the code.
- everforward 7mo agoStatic 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.