Skip to content

Fix deepcopying on Python 3.11

Michael Kuron requested to merge py311 into master

Python 3.11 added object.__setstate__ (, which breaks our fix for #40 (closed), but only on Sympy version 1.11 because that version added sympy.Basic.__setstate__ ( The updated fix is actually more logical (because it actually does what the comment says), so hopefully it will survive future version updates better.

This fixes both the AttributeError: 'tuple' object has no attribute 'items' issue which we already have a fix for in !327 (closed), and the sp.Pow issue that came up next.

Tested with Python 3.10 and 3.11 and Sympy 1.9 and 1.11.

@holzer, you'll need to merge manually because of builds failing due to !327 (closed).

Edited by Michael Kuron

Merge request reports