[Python-Dev] Empty directory is a namespace?

"Martin v. Löwis" martin at v.loewis.de
Sun Jun 24 21:27:56 CEST 2012


>> In short, it's not worth worrying about, and definitely nothing that
>> should cause people to spread an idea that __init__.py somehow speeds
>> things up.
> 
> The best way to avoid people spreading that idea would be to show hard
> measurements.

PJE wants people to spread an idea, not to avoid them doing so.

In any case, hard measurements might help to spread the idea, here are
mine. For the attached project, ec656d79b8ac gives, on my system

import time for a namespace package: 113µs (fastest run, hot caches)
import time for a regular package:   128µs (---- " ------)
first-time import of regular package: 1859µs (due to pyc generation)
(remove __init__.py and __pycache__ to construct the first setup)

So namespace packages are indeed faster than regular packages, at least
in some cases.

Regards,
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spacetiming.tgz
Type: application/x-compressed-tar
Size: 386 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120624/0644803a/attachment-0001.bin>


More information about the Python-Dev mailing list