[wingide-users] Pickling modules with `copy_reg`

cool-RR cool-rr at cool-rr.com
Mon Apr 19 08:42:18 MDT 2010

On Mon, Apr 19, 2010 at 4:32 PM, Wingware Support <support at wingware.com> wrote:
> cool-RR wrote:
>> I figured out an hack:
>> '''
>> import __builtin__
>> def __import__(*args, **kwargs):
>>    return __builtin__.__import__(*args, **kwargs)
>> '''
>> Then I use this custom `__import__` in the reducer. It's an ugly hack, and
>> only needed when debugging with Wing.
> OK, glad you found a work-around.  I'm still not clear on why you would
> be pickling up __import__.  I'd try to design the code so you're not
> depending on pickling of code, but just data/objects and assume that the
> subprocess is launched w/ the required code in place.  But maybe I'm
> just a fuddy duddy. ;-)
> --
> Stephan Deibel

I know it's ridiculous to pickle `__import__`. The reason I'm doing it
is because I'm pickling a module, just by having it imported according
to its name, so `__import__` is part of the reducer and thus needs to
get pickled itself.


More information about the wingide-users mailing list