[Python-Dev] __file__

Barry Warsaw barry at python.org
Fri Feb 26 23:37:30 CET 2010


On Feb 26, 2010, at 02:09 PM, Brett Cannon wrote:

>But a benefit of no longer supporting bytecode-only modules by default is it
>cuts back on possible stat calls which slows down Python's startup time (a
>complaint I hear a lot). Performance issues become even more acute if you try
>to come up with even a remotely proper way to have backwards-compatible
>support in importlib for its ABCs w/o forcing caching on all implementors of
>the ABCs.

>And personally, I don't see what bytecode-only modules buy you. The
>obfuscation argument is bunk as we all know.

Brett really hits the nail on the head, and yes I'm sorry for not being clear
about what "we discussed this at Pycon" meant.  The "we" being Brett and I of
course (and Chris Withers IIRC).

Bytecode-only deployments are a bit of a sham, and definitely a minority use
case, so why should all of Python pay for the extra stat calls to support this
by default?  How many people would actually be hurt if this wasn't available
out of the box, especially since you can still support it if you really want
it and can't convince your manager that it provides essentially zero useful
obfuscation of your code?

I say this having been down that road myself with a previous employer.
Management was pretty adamant about wanting this until I explained how easy it
was to defeat and convinced them that the engineering resources to do it were
better spent elsewhere.

Having said that, I'd be all for including a reference implementation of a
bytecode-only loader in the PEP for demonstration purposes.  Greg, would you
like to contribute that?

-Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-dev/attachments/20100226/61c3ac6a/attachment.pgp>


More information about the Python-Dev mailing list