
    ph                     $    S SK Jr   " S S5      rg)   )	DataErrorc                   2    \ rS rSrSrSrS rS rS	S jrSr	g)
Encoder   z=Encode strings to bytes-like and decode bytes-like to stringsencodingencoding_errorsdecode_responsesc                 (    Xl         X l        X0l        g )Nr   )selfr   r	   r
   s       Q/home/james-whalen/.local/lib/python3.13/site-packages/redis/_parsers/encoders.py__init__Encoder.__init__	   s     . 0    c                    [        U[        [        45      (       a  U$ [        U[        5      (       a  [	        S5      e[        U[
        [        45      (       a  [        U5      R                  5       nO9[        U[        5      (       d$  [        U5      R                  n[	        SU S35      e[        U[        5      (       a&  UR                  U R                  U R                  5      nU$ )z=Return a bytestring or bytes-like representation of the valuezNInvalid input of type: 'bool'. Convert to a bytes, string, int or float first.zInvalid input of type: 'z2'. Convert to a bytes, string, int or float first.)
isinstancebytes
memoryviewboolr   intfloatreprencodestrtype__name__r   r	   )r   valuetypenames      r   r   Encoder.encode   s    eeZ011Lt$$5  U|,,K&&(EE3''E{++H*8* 5B C  eS!!LL0D0DEEr   c                     U R                   (       d  U(       a`  [        U[        5      (       a  UR                  5       n[        U[        5      (       a&  UR                  U R                  U R                  5      nU$ )z:Return a unicode string from the bytes-like representation)r
   r   r   tobytesr   decoder   r	   )r   r   forces      r   r"   Encoder.decode%   sQ      E%,,%''T]]D4H4HIr   )r
   r   r	   N)F)
r   
__module____qualname____firstlineno____doc__	__slots__r   r   r"   __static_attributes__ r   r   r   r      s    CAI1
.r   r   N)
exceptionsr   r   r+   r   r   <module>r-      s    "( (r   