[Python-Dev] Issue #11051: system calls per import

Georg Brandl georg at python.org
Sun Jan 30 10:25:05 CET 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 30.01.2011 09:56, schrieb Victor Stinner:
> Hi,
> 
> Antoine Pitrou noticed that Python 3.2 tries a lot of filenames to load
> a module:
> http://bugs.python.org/issue11051
> 
> Python 3.1 does already test many filenames, but with Python 3.2, it is
> even worse.
> 
> For each directory in sys.path, it tries 9 suffixes: '',
> '.cpython-32m.so', 'module.cpython-32m.so', '.abi3.so',
> 'module.abi3.so', '.so', 'module.so', '.py', '.pyc'.

'' is not really a suffix, but a test for a package directory.

> I don't understand why it tests so much .so suffixes.

Because of PEP 3149 and PEP 384.

> And why it does test with and without "module".

Because it always did (there's a thing called backwards compatibility.)

This is of course probably the obvious one to start a deprecation process.

Georg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1FLnEACgkQN9GcIYhpnLApaACdGDe9qVlZNVHRF92yTqYnYFIp
hjIAn34YqvMy8fy7pcz0qAlS/WhRWR4G
=1b9C
-----END PGP SIGNATURE-----


More information about the Python-Dev mailing list