For those trying to reproduce this on more recent Python versions, the attribute list for CodeType has changed. As of 3.11, it's 'co_argcount', 'co_posonlyargcount', 'co_kwonlyargcount', 'co_nlocals', 'co_stacksize', 'co_flags', 'co_code', 'co_consts', 'co_names', 'co_varnames', 'co_filename', 'co_name', 'co_qualname', 'co_firstlineno', 'co_linetable', 'co_exceptiontable', 'co_freevars', 'co_cellvars',
Great video! I did not watch it completely, so maybe it has been mentioned, but by using the ctypes module and the fact id() returns adresses in memory on CPython, we can well modify co_consts in place. Just my 2 cents for what was told around 21:00.
I don't think so. tail call recursion would required that function calls know how build a stack frame on top of an existing one, which is done in the interpreter and not supported by the byte code.
For those trying to reproduce this on more recent Python versions, the attribute list for CodeType has changed. As of 3.11, it's
'co_argcount', 'co_posonlyargcount', 'co_kwonlyargcount', 'co_nlocals', 'co_stacksize', 'co_flags', 'co_code',
'co_consts', 'co_names', 'co_varnames', 'co_filename', 'co_name', 'co_qualname', 'co_firstlineno', 'co_linetable',
'co_exceptiontable', 'co_freevars', 'co_cellvars',
Great Duo. What a pleasant and informative presentation.
The passion is real! Thanks a lot for this awesome talk and the glimpse behind the curtain :-)
Great video!
I did not watch it completely, so maybe it has been mentioned, but by using the ctypes module and the fact id() returns adresses in memory on CPython, we can well modify co_consts in place. Just my 2 cents for what was told around 21:00.
What a presentation! Mind blown!
Look where we meet again! :D
@@nilashishchakraborty3983 This was really one of the most entertaining presentations I've ever seen.
This was brilliant!
Would it be possible to use bytecode manipulation to help make optimizations like tail call recursion?
I don't think so. tail call recursion would required that function calls know how build a stack frame on top of an existing one, which is done in the interpreter and not supported by the byte code.
what console are they using? it looks like it's running in chrome :-?
ktxed ipython notebook
Awesome
Good
baddone 😂😂