class_docstr: Mixin class that allows to pickle objects with ``__slots__``.
  
  Examples
  ========
  
  First define a class that mixes :class:`PicklableWithSlots` in::
  
      >>> from sympy.polys.polyutils import PicklableWithSlots
      >>> class Some(PicklableWithSlots):
      ...     __slots__ = ('foo', 'bar')
      ...
      ...     def __init__(self, foo, bar):
      ...         self.foo = foo
      ...         self.bar = bar
  
  To make :mod:`pickle` happy in doctest we have to use these hacks::
  
      >>> import builtins
      >>> builtins.Some = Some
      >>> from sympy.polys import polyutils
      >>> polyutils.Some = Some
  
  Next lets see if we can create an instance, pickle it and unpickle::
  
      >>> some = Some('abc', 10)
      >>> some.foo, some.bar
      ('abc', 10)
  
      >>> from pickle import dumps, loads
      >>> some2 = loads(dumps(some))
  
      >>> some2.foo, some2.bar
      ('abc', 10)
class_docstr_tok: ["Mixin","class","that","allows","to","pickle","objects","with","``","__slots__","``",".","Examples","========","First","define","a","class","that","mixes",":","class",":","`","PicklableWithSlots","`","in",":",":",">",">",">","from","sympy.polys.polyutils","import","PicklableWithSlots",">",">",">","class","Some","(","PicklableWithSlots",")",":","...","__slots__","=","(","'foo","'",",","'bar","'",")","...","...","def","__init__","(","self",",","foo",",","bar",")",":","...","self.foo","=","foo","...","self.bar","=","bar","To","make",":","mod",":","`","pickle","`","happy","in","doctest","we","have","to","use","these","hacks",":",":",">",">",">","import","builtins",">",">",">","builtins.Some","=","Some",">",">",">","from","sympy.polys","import","polyutils",">",">",">","polyutils.Some","=","Some","Next","lets","see","if","we","can","create","an","instance",",","pickle","it","and","unpickle",":",":",">",">",">","some","=","Some","(","'abc","'",",","10",")",">",">",">","some.foo",",","some.bar","(","'abc","'",",","10",")",">",">",">","from","pickle","import","dumps",",","loads",">",">",">","some2","=","loads","(","dumps","(","some",")",")",">",">",">","some2.foo",",","some2.bar","(","'abc","'",",","10",")"]
code: def __setstate__(self, d):
      # All values that were pickled are now assigned to a fresh instance
      for name, value in d.items():
          setattr(self, name, value)
  
imports: from __future__ import annotations
  from sympy.external.gmpy import GROUND_TYPES
  from sympy.core import S, Add, Mul, Pow, Eq, Expr, expand_mul, expand_multinomial
  from sympy.core.exprtools import decompose_power, decompose_power_rat
  from sympy.core.numbers import _illegal
  from sympy.polys.polyerrors import PolynomialError, GeneratorsError
  from sympy.polys.polyoptions import build_options
  import re
label_desc: Use image node_id 2 for calling the PicklableWithSlots obj's underlying member method code with example usage: obj.__setstate__(d) without return types