On Wed, Jul 14, 2010 at 05:15, Nick Coghlan wrote:
> On Wed, Jul 14, 2010 at 9:05 PM, Steve Holden 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 impo
On Wed, Jul 14, 2010 at 9:05 PM, Steve Holden 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 about import
Brett Cannon wrote:
>
>
> On Tue, Jul 13, 2010 at 11:34, Alexander Belopolsky
> mailto:alexander.belopol...@gmail.com>>
> wrote:
>
> On Tue, Jul 13, 2010 at 1:57 PM, Benjamin Peterson
> mailto:benja...@python.org>> wrote:
> ..
> > No! That's not recommended and a complete hack. T
On Tue, Jul 13, 2010 at 4:52 PM, Brett Cannon 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 *specifically* to
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
> wrote:
> ..
> > No! That's not recommended and a complete hack. The "dance" or
> > importlib.import_module is preferred.
>
> Nevertheless, "a complet
On Tue, Jul 13, 2010 at 1:57 PM, Benjamin Peterson 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)
{
static PyObj
On Tue, Jul 13, 2010 at 1:57 PM, Benjamin Peterson wrote:
> 2010/7/13 Alexander Belopolsky :
>> On Tue, Jul 13, 2010 at 11:34 AM, Antoine Pitrou wrote:
>>> On Tue, 13 Jul 2010 11:25:23 -0400
>> ..
>>> Only for top-level modules:
>>>
>> __import__("distutils.core", level=0)
>>> >> '/home/antoi
2010/7/13 Alexander Belopolsky :
> On Tue, Jul 13, 2010 at 11:34 AM, Antoine Pitrou wrote:
>> On Tue, 13 Jul 2010 11:25:23 -0400
> ..
>> Only for top-level modules:
>>
> __import__("distutils.core", level=0)
>> > '/home/antoine/py3k/__svn__/Lib/distutils/__init__.py'>
> sys.modules["distut
On 13/07/2010 16:46, Alexander Belopolsky wrote:
On Tue, Jul 13, 2010 at 11:34 AM, Antoine Pitrou wrote:
On Tue, 13 Jul 2010 11:25:23 -0400
..
Only for top-level modules:
__import__("distutils.core", level=0)
sys.modules["distutils.core"]
On Tue, Jul 13, 2010 at 11:34 AM, Antoine Pitrou wrote:
> On Tue, 13 Jul 2010 11:25:23 -0400
..
> Only for top-level modules:
>
__import__("distutils.core", level=0)
> '/home/antoine/py3k/__svn__/Lib/distutils/__init__.py'>
sys.modules["distutils.core"]
> '/home/antoine/py3k/__svn__/Li
On Tue, 13 Jul 2010 11:25:23 -0400
Alexander Belopolsky 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 builtins.__import__ is over
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 t
12 matches
Mail list logo