Brett Cannon wrote:
On Tue, Jul 13, 2010 at 11:34, Alexander Belopolsky
alexander.belopol...@gmail.com mailto:alexander.belopol...@gmail.com
wrote:
On Tue, Jul 13, 2010 at 1:57 PM, Benjamin Peterson
benja...@python.org mailto:benja...@python.org wrote:
..
No! That's
On Wed, Jul 14, 2010 at 9:05 PM, Steve Holden st...@holdenweb.com wrote:
I have stopped fixing bugs related to this in import.c because of the
annoying issues it causes and I expect the correct approach to gain
traction at some point (plus get importlib bootstrapped in so I don't
have to care
On Wed, Jul 14, 2010 at 05:15, Nick Coghlan ncogh...@gmail.com wrote:
On Wed, Jul 14, 2010 at 9:05 PM, Steve Holden st...@holdenweb.com wrote:
I have stopped fixing bugs related to this in import.c because of the
annoying issues it causes and I expect the correct approach to gain
traction
When pickle.py needs to import a module by name, it goes through a
peculiar dance of
__import__(module, level=0)
mod = sys.modules[module]
As far as I can tell, unless builtins.__import__ is overridden or
sys.modules clobbered by user code, the above should be equivalent
On Tue, 13 Jul 2010 11:25:23 -0400
Alexander Belopolsky alexander.belopol...@gmail.com wrote:
When pickle.py needs to import a module by name, it goes through a
peculiar dance of
__import__(module, level=0)
mod = sys.modules[module]
As far as I can tell, unless
On Tue, Jul 13, 2010 at 11:34 AM, Antoine Pitrou solip...@pitrou.net wrote:
On Tue, 13 Jul 2010 11:25:23 -0400
..
Only for top-level modules:
__import__(distutils.core, level=0)
module 'distutils' from
'/home/antoine/py3k/__svn__/Lib/distutils/__init__.py'
sys.modules[distutils.core]
On 13/07/2010 16:46, Alexander Belopolsky wrote:
On Tue, Jul 13, 2010 at 11:34 AM, Antoine Pitrousolip...@pitrou.net wrote:
On Tue, 13 Jul 2010 11:25:23 -0400
..
Only for top-level modules:
__import__(distutils.core, level=0)
module 'distutils' from
2010/7/13 Alexander Belopolsky alexander.belopol...@gmail.com:
On Tue, Jul 13, 2010 at 11:34 AM, Antoine Pitrou solip...@pitrou.net wrote:
On Tue, 13 Jul 2010 11:25:23 -0400
..
Only for top-level modules:
__import__(distutils.core, level=0)
module 'distutils' from
On Tue, Jul 13, 2010 at 1:57 PM, Benjamin Peterson benja...@python.org wrote:
2010/7/13 Alexander Belopolsky alexander.belopol...@gmail.com:
On Tue, Jul 13, 2010 at 11:34 AM, Antoine Pitrou solip...@pitrou.net wrote:
On Tue, 13 Jul 2010 11:25:23 -0400
..
Only for top-level modules:
On Tue, Jul 13, 2010 at 1:57 PM, Benjamin Peterson benja...@python.org wrote:
..
No! That's not recommended and a complete hack. The dance or
importlib.import_module is preferred.
Nevertheless, a complete hack is what PyImport_Import does:
PyObject *
PyImport_Import(PyObject *module_name)
{
On Tue, Jul 13, 2010 at 11:34, Alexander Belopolsky
alexander.belopol...@gmail.com wrote:
On Tue, Jul 13, 2010 at 1:57 PM, Benjamin Peterson benja...@python.org
wrote:
..
No! That's not recommended and a complete hack. The dance or
importlib.import_module is preferred.
Nevertheless, a
On Tue, Jul 13, 2010 at 4:52 PM, Brett Cannon br...@python.org wrote:
..
Pulling from sys.modules is the correct way to do this. There are subtle
issues when using a bunk fromlist argument (empty modules, double
initialization, etc.). If one does not use importlib.import_module --
written
12 matches
Mail list logo