
    h                     (    S r SSKJr   " S S5      rg)zJClass for pickling and unpickling objects via their constructor arguments.    )Anyc                   6    \ rS rSrSrS\S\4S jrS rS rSr	g	)
EzPickle   a_  Objects that are pickled and unpickled via their constructor arguments.

Example:
    >>> class Animal: pass
    >>> class Dog(Animal, EzPickle):
    ...    def __init__(self, furcolor, tailkind="bushy"):
    ...        Animal.__init__(self)
    ...        EzPickle.__init__(self, furcolor, tailkind)

When this object is unpickled, a new ``Dog`` will be constructed by passing the provided furcolor and tailkind into the constructor.
However, philosophers are still not sure whether it is still the same dog.

This is generally needed only for environments which wrap C/C++ code, such as MuJoCo and Atari.
argskwargsc                     Xl         X l        g)zLUses the ``args`` and ``kwargs`` from the object's constructor for pickling.N_ezpickle_args_ezpickle_kwargs)selfr   r   s      R/home/james-whalen/.local/lib/python3.13/site-packages/gymnasium/utils/ezpickle.py__init__EzPickle.__init__   s    " &    c                 4    U R                   U R                  S.$ )z5Returns the object pickle state with args and kwargs.r
   r
   )r   s    r   __getstate__EzPickle.__getstate__   s      #11 $ 5 5
 	
r   c                 |    [        U 5      " US   0 US   D6nU R                  R                  UR                  5        g)z%Sets the object pickle state using d.r   r   N)type__dict__update)r   douts      r   __setstate__EzPickle.__setstate__"   s7    4j!,-G3E1FGS\\*r   r
   N)
__name__
__module____qualname____firstlineno____doc__r   r   r   r   __static_attributes__ r   r   r   r      s$    'c 'S '

+r   r   N)r!   typingr   r   r#   r   r   <module>r%      s    P + +r   