[Python-ideas] Module aliases and/or "real names"
Ron Adam
rrr at ronadam.com
Mon Jan 10 19:49:15 CET 2011
On 01/10/2011 11:55 AM, Ron Adam wrote:
> How about making __module__ a property on accelerated objects, that looks
> for a global flag, then returned either, _module__ or _alt_module__
> depending on the flag? (or some other way of store those values)
>
> Pickle could set the flag so it can get what it needs from __module__, then
> unset it when it's done.
Or this maybe should be the other way around. When a module begins with an
underscore it should be considered a private implementation detail. So
__module__, in the case of partial, is already set to the correct value.
But when the actual name is needed instead of the official name, A global
flag can be set. Then when module is a property, it will get the actual
name, instead of the official name.
Cheers,
Ron
More information about the Python-ideas
mailing list