[off-topic] Re: What do perl lovers like about python?
Tara L Andrews
chrysaphi at gmail.com
Wed Aug 22 16:40:19 BST 2007
On 22 Aug 2007, at 16:28, Nigel Rantor wrote:
> Well, firstly, can you give me some more detail about what you mean.
Not much, because I don't have access to that code anymore to remind
myself of what I did, nor the books that explained it to me. I'll do
my best though.
The idea is that you write your own import logic, and then redefine
"import" to call the function you just wrote. As it is, "import"
calls __import__, as listed here:
The description of __import__ describes, in part, what I'm talking
I *think* I got all this from the Python Cookbook, but I could be wrong.
> Secondly, can I just say that I think this could be cleaned up. I
> don't see the advantage of the Python way here. If you need module
> specific initialisation what's wrong with BEGIN blocks? (I'm sure
> there are arguments, I just don't know what they are right now)
You can say whatever you like. I'm not defending Python, since
honestly I don't like it very much. I just spoke up to say that I
have had the problem you described and was able to solve it.
More information about the london.pm