
    e!hb                     r    d Z ddlmZ ddlmZ  edddg      Z G d d      Z G d	 d
      Z G d d      Zy)z"Mixing classes for the RETE nodes.    )
namedtuple)Callable	ChildNodenodecallbackc                       e Zd ZdZd Zy)NoMemoryz0The node has no memory so we have nothing to do.c                      y )N selfs    d/var/www/html/diagnosisapp-backend/venv/lib/python3.12/site-packages/experta/matchers/rete/mixins.py_resetzNoMemory._reset   s        N)__name__
__module____qualname____doc__r   r   r   r   r	   r	   
   s
    :r   r	   c                       e Zd ZdZd Zy)AnyChildz,This node allow any kind of node as a child.c                 l    || j                   vr&| j                   j                  t        ||             yy)z*Add node and callback to the children set.N)childrenappendr   )r   r   r   s      r   	add_childzAnyChild.add_child   s,    t}}$MM  4!:; %r   N)r   r   r   r   r   r   r   r   r   r      s
    6<r   r   c                   (     e Zd ZdZ fdZd Z xZS )
HasMatcherz-This node need a match callable as parameter.c                     	 t        |t              sJ 	 || _        t
        |           y# t        $ r}t	        |      |d}~ww xY w)z5If `matcher` is a callable, assign to `self.matcher`.N)
isinstancer   matcherAssertionError	TypeErrorsuper__init__)r   r   exc	__class__s      r   r#   zHasMatcher.__init__   sJ    	#gx000 #DL  	*C.c)	*s   , 	AAAc                 L    | j                   j                  d| j                  S )Nz: )r%   r   r   r   s    r   __str__zHasMatcher.__str__(   s    >>22DLLAAr   )r   r   r   r   r#   r'   __classcell__)r%   s   @r   r   r      s    7	Br   r   N)	r   collectionsr   collections.abcr   r   r	   r   r   r   r   r   <module>r+      sA    ( " $ {VZ$89	 < <B Br   