OK, once I ignored the _mhash entry then an error showed up in the
is_number routine for im(x). is_number(im(x)) comes back as False from
the old routine and True from mine since im(x).diff(x) = 0. So
apparently there was no test involving im(x) until the pickling tests
and the different results fr
If I understand correctly, it should be important that the pickled/copied
object has the same hash as the original.
Aaron Meurer
On Sep 7, 2010, at 4:29 PM, smichr wrote:
> In the place where the error occurs, you have a pre-pickle value, a,
> and a post-pickle value b:
>
> b = pickle.loads(
In the place where the error occurs, you have a pre-pickle value, a,
and a post-pickle value b:
b = pickle.loads(pickle.dumps(a, protocol))
protocol varies over 0, 1, 2;
b is also computed with copy and deepcopy:
b = copy(a) or b = deepcopy(b)
The directories of a and b are computed and assert
Different orderings in dictionaries is expected behavior and shouldn't be
causing any bugs (because the dictionary is basically an unordered container).
I really have a hard time understanding what is going on here actually.
By the way, going back to the original code, you shouldn't be calling
OK, I think it's something that happens when expand is called. Perhaps
due to caching? If I put e = self.expand(mul=1) above the loop over
self.symbols then I get two errors. I go to the releveant code in test
pickling and print out the attribute and the values of a and b that
are being compared as
On Sep 7, 2010, at 3:33 PM, smichr wrote:
> The "if 1" part just makes it not run the lower part of the routine,
> i.e. it uses the original routine. When that is changed to 0 then it
> runs the upper part; computes a result using the lower part; asserts
> that the answers are the same and returns
The "if 1" part just makes it not run the lower part of the routine,
i.e. it uses the original routine. When that is changed to 0 then it
runs the upper part; computes a result using the lower part; asserts
that the answers are the same and returns the answer.
Running the top part causes the pickl