Phillip J. Eby wrote:
I meant that just changing its class is a mutation, and since immutables
can be shared or cached, that could lead to problems. So I do think
it's a reasonable implementation limit to disallow changing the
__class__ of an immutable.
That's a fair point.
Although I
Greg Ewing [EMAIL PROTECTED] writes:
Phillip J. Eby wrote:
At 01:47 PM 10/13/2005 +1300, Greg Ewing wrote:
I'm trying to change the __class__ of a newly-imported
module to a subclass of types.ModuleType
It happened in Python 2.3, actually.
Is there a discussion anywhere about the
At 04:02 PM 10/13/2005 +0100, Michael Hudson wrote:
Greg Ewing [EMAIL PROTECTED] writes:
Phillip J. Eby wrote:
At 01:47 PM 10/13/2005 +1300, Greg Ewing wrote:
I'm trying to change the __class__ of a newly-imported
module to a subclass of types.ModuleType
It happened in Python 2.3,
Why not lazily import modules by importing them when they are needed
(i.e inside functions), and not in the top-level module scope?
On 10/13/05, Phillip J. Eby [EMAIL PROTECTED] wrote:
At 04:02 PM 10/13/2005 +0100, Michael Hudson wrote:
Greg Ewing [EMAIL PROTECTED] writes:
Phillip J. Eby
Eyal Lotem [EMAIL PROTECTED] wrote:
Why not lazily import modules by importing them when they are needed
(i.e inside functions), and not in the top-level module scope?
Because then it wouldn't be automatic.
The earlier portion of this discussion came from...
import module
#module.foo
Josiah Carlson wrote:
The earlier portion of this discussion came from...
import module
#module.foo does not reference a module
module.foo
#now module.foo references a module
Or more generally, module.foo now references *something*,
not necessarily a module. (In my use
I just tried to implement an autoloader using a technique
I'm sure I used in an earlier Python version, but it no
longer seems to be allowed.
I'm trying to change the __class__ of a newly-imported
module to a subclass of types.ModuleType, but I'm getting
TypeError: __class__ assignment: only