New submission from Nick Coghlan <[EMAIL PROTECTED]>: The package level imports from the new multiprocessing package exhibit some very strange behaviour because they are actually functions pretending to be classes:
Python 2.6b1+ (trunk:64945, Jul 14 2008, 20:00:46) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import multiprocessing as mp >>> isinstance(mp.Lock(), mp.Lock) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types >>> mp.Lock.__name__ 'Lock' >>> mp.Lock.__module__ 'multiprocessing' >>> mp.Lock().__class__.__name__ 'Lock' >>> mp.Lock().__class__.__module__ 'multiprocessing.synchronize' The delayed import functions in multiprocessing.__init__ look like a serious misfeature to me. I'd be inclined to replace them with "from .synchronize import *" and "from .process import *" (leaving anything which isn't covered by those two imports to be retrieved directly from the relevant mp submodule) ---------- assignee: jnoller components: Library (Lib) messages: 71327 nosy: jnoller, ncoghlan priority: critical severity: normal status: open title: Misleading names for multiprocessing "convenience" functions versions: Python 2.6, Python 3.0 _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3589> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com