[Python-ideas] Implicit submodule imports
random832 at fastmail.us
random832 at fastmail.us
Fri Sep 26 19:43:31 CEST 2014
On Fri, Sep 26, 2014, at 00:24, Guido van Rossum wrote:
> There is no custom allocation for modules, and even for float I don't see
> how switching types back and forth between float and a subclass could
> corrupt the free list
For float I'd be worried more about the fact that it's supposed to be
immutable. It would be entirely reasonable for an implementation to make
all floats with the same value the same object (as cpython does do for
ints in a certain range), and what happens if you change its type then?
And even if it doesn't do so, it does for literals with the same value
in the same function.
So, realistically, an immutable type (especially an immutable type which
has literals or another interning mechanism) needs to forbid __class__
from being assigned.
More information about the Python-ideas
mailing list