On Sun, 24 Jun 2012 13:44:52 -0400 PJ Eby <[email protected]> wrote: > On Sun, Jun 24, 2012 at 3:51 AM, "Martin v. Löwis" <[email protected]>wrote: > > > On 23.06.2012 17:58, Antoine Pitrou wrote: > > > On Sat, 23 Jun 2012 17:55:24 +0200 > > > [email protected] wrote: > > >>> That's true. I would have hoped for it to be recognized only when > > >>> there's at least one module or package inside, but it doesn't sound > > >>> easy to check for (especially in the recursive namespace packages case > > >>> - is that possible?). > > >> > > >> Yes - a directory becomes a namespace package by not having an > > __init__.py, > > >> so the "namespace package" case will likely become the default, and > > people > > >> will start removing the empty __init__.pys when they don't need to > > support > > >> 3.2- anymore. > > > > > > Have you tested the performance of namespace packages compared to > > > normal packages? > > > > No, I haven't. > > > > It's probably not worthwhile; any performance cost increase due to looking > at more sys.path entries should be offset by the speedup of any subsequent > imports from later sys.path entries. > > Or, to put it another way, almost all the extra I/O cost of namespace > packages is paid only once, for the *first* namespace package imported.
And how about CPU cost? > 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. Regards Antoine. _______________________________________________ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
