Skip to content

Conversation

@bjodah
Copy link
Contributor

@bjodah bjodah commented Nov 24, 2025

This draft-PR tracks symengine/symengine#2129

@bjodah bjodah force-pushed the extended-testing-pickling branch from 551c16e to f7f0293 Compare November 24, 2025 10:12
@bjodah bjodah force-pushed the extended-testing-pickling branch from 5df2f13 to 87ff8a3 Compare November 24, 2025 13:09
@bjodah
Copy link
Contributor Author

bjodah commented Nov 24, 2025

So when using:
symengine/symengine@d10ee0b

we get this pytest failure consistently:

________________________________ test_pysymbol _________________________________

    def test_pysymbol():
        a = MySymbol("hello", attr=1)
        b = pickle.loads(pickle.dumps(a + 2)) - 2
        c = MySymbol("hello", attr=-1)
        try:
>           assert a == b
E           assert hello == hello

symengine/tests/test_pickling.py:43: AssertionError

(b is no longer a MySymbol instance but simply an instance of Symbol). As to why this happens: I'm currently clueless, my understanding was that the information regarding the python instance would be by the pickling mechanism (i.e. outside of the serialized c++ representation), but clearly I'm missing something.

@bjodah bjodah closed this Nov 24, 2025
@bjodah bjodah reopened this Nov 24, 2025
@bjodah
Copy link
Contributor Author

bjodah commented Nov 24, 2025

Nevermind, here's the reason:

void save_basic(RCPBasicAwareOutputArchive<cereal::PortableBinaryOutputArchive> &ar, const Symbol &b)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant