You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "<stdin>", line 1, in<module>
File "/usr/lib/python3.8/copy.py", line 161, in deepcopy
rv = reductor(4)
File "/hdd/tmp/tempvenv/lib/python3.8/site-packages/numpy/polynomial/_polybase.py", line 502, in __getstate__
ret['symbol'] = self.symbol.copy()
AttributeError: 'str' object has no attribute 'copy'
NumPy/Python version information:
1.24.0rc1 3.8.10 (default, Jun 22 2022, 20:18:18)
[GCC 9.4.0]
Context for the issue:
Easy fix in the bug description.
The text was updated successfully, but these errors were encountered:
On line 502, self.symbol.copy() was called, which
causes an AttributeError, since self.symbol is a
string, so it doesn't have a copy() method. To fix
it, I simply removed the copy() and directly assigned
the string.
On line 502, self.symbol.copy() was called, which
causes an AttributeError, since self.symbol is a
string, so it doesn't have a copy() method. To fix
it, I simply removed the copy() and directly assigned
the string.
Describe the issue:
The issue is at line 502 in _polybase.py:
ret['symbol'] = self.symbol.copy()
Pronblem is that self.symbol is a string and has no copy method. Instead should be assigned directly as it is immutable:
ret['symbol'] = self.symbol
Reproduce the code example:
Error message:
NumPy/Python version information:
1.24.0rc1 3.8.10 (default, Jun 22 2022, 20:18:18)
[GCC 9.4.0]
Context for the issue:
Easy fix in the bug description.
The text was updated successfully, but these errors were encountered: