Jaymon / pout

Python pretty print on steroids
MIT License
29 stars 0 forks source link

Convert Call.get_src_lines to using linecache? #98

Open Jaymon opened 4 weeks ago

Jaymon commented 4 weeks ago

Currently, I just read the file in using the plain old open function, but I'm wondering if it would be better to just get the lines I need using linecache.getline.

I could just read the lines I need and then keep adding lines as I need them to a list of retrieved lines.

The bad part would be if I ever do the AST parsing, I'll still need to read the full file in. And it also would be a bit more complex to keep track of reading in the lines and going through them to find the full codeblock I want