[Python-Dev] Reading Python source file (original) (raw)

Nick Coghlan ncoghlan at gmail.com
Wed Nov 18 21:30:15 EST 2015


On 19 November 2015 at 02:50, Ryan Gonzalez <rymg19 at gmail.com> wrote:

Well, not quite the same thing, but https://github.com/kirbyfan64/pfbuild/blob/master/pfbuild embeds the compressed version of 16k LOC. Would it be affected negatively in any way be this?

Since all the data is on one line, I'd think the old (current) parser would end up reading in the whole line anyway.

Right. The other main "embedded binary blob" case I'm familiar with is get-pip.py, which embeds a base85 encoded copy of pip as a zip archive in a DATA variable, and there aren't any appending tricks there either

Two things worth keeping in mind here is that if a script is embedding enough data for reading the whole thing into memory it to pose a problem:

We couldn't make a change like this in a maintenance release, but for a new feature release, the consistency gain is definitely worth it.

Cheers, Nick.

-- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia



More information about the Python-Dev mailing list