3 ms·
This is super interesting! I've never seen codecs used to introduce language features like this... Do you have any good references for getting started with usin
by closed 7y ago
This is super interesting! I've never seen codecs used to introduce language features like this... Do you have any good references for getting started with using codecs?
Also, I wonder if there's an easy way to implement this in a jupyter notebook, without fiddling with the kernel...
(issues of whether it's a good idea aside, definitely seems useful to know about.. )
- kolinko 7y agoThanks! The idea for using codecs is not mine - found it on StackOverflow somewhere. Googling for "how to add custom language statements python" should give you some results, this included :) Also, in my case I had to use Codecs because a new operator causes AST-parser to not go through. But if you have some kind of syntax that will be compatible with Python AST, then you can implement it even easier. You can google Python AST to get a lot of useful information :)