3 ms·
How does it translate generator expressions? Some kind of byte-code magic?
by luckystarr 14y ago
How does it translate generator expressions? Some kind of byte-code magic?
- deleted 14y ago[deleted]
- yangyang 14y agoIt appears to build an AST from the code object on the generator, and then translate to SQL. https://github.com/ponyorm/pony/blob/orm/pony/orm/decompiling.py https://github.com/ponyorm/pony/blob/orm/pony/orm/decompilin... https://github.com/ponyorm/pony/blob/orm/pony/orm/asttranslation.py https://github.com/ponyorm/pony/blob/orm/pony/orm/asttransla...
- amalashkevich 14y agoPony gets the code object from a generator, decompiles it to a Python AST and then translates it to a SQL abstract tree.