o
    ij                     @   s@   d Z ddlmZ ddlmZ ddlmZ eG dd deZdS )z2Implementation of :class:`CompositeDomain` class.     )Domain)GeneratorsError)publicc                   @   sf   e Zd ZdZdZdgd \ZZZZdd Z	dd Z
d	d
 Zedd Zdd Zedd Zdd ZdS )CompositeDomainz5Base class for composite domains, e.g. ZZ[x], ZZ(X). TN   c                 G   s<   t | jt |@ s| | j| j| | jS td| j|f )z%Inject generators into this domain.  zcommon generators in %s and %s)setsymbols	__class__domainorderr   )selfr    r   r/var/www/html/eduruby.in/lip-sync/lip-sync-env/lib/python3.10/site-packages/sympy/polys/domains/compositedomain.pyinject   s   zCompositeDomain.injectc                    sD   t | t fdd| jD }| jj| }|s|S | ||| jS )z"Drop generators from this domain. c                 3   s    | ]	}| vr|V  qd S Nr   ).0sZsymsetr   r   	<genexpr>   s    z'CompositeDomain.drop.<locals>.<genexpr>)r   tupler   r
   dropr	   r   )r   r   Znewsymsr
   r   r   r   r      s   zCompositeDomain.dropc                 C   s   |  || j| jS )z&Set the ground domain of this domain. )r	   r   r   )r   r
   r   r   r   
set_domain"   s   zCompositeDomain.set_domainc                 C      | j jS )z*Returns ``True`` if this domain is exact. )r
   is_Exactr   r   r   r   r   &   s   zCompositeDomain.is_Exactc                 C   s   |  | j S )z)Returns an exact version of this domain. )r   r
   	get_exactr   r   r   r   r   +   s   zCompositeDomain.get_exactc                 C   r   r   )r
   has_CharacteristicZeror   r   r   r   r   /   s   z&CompositeDomain.has_CharacteristicZeroc                 C   s
   | j  S r   )r
   characteristicr   r   r   r   r   3   s   
zCompositeDomain.characteristic)__name__
__module____qualname____doc__Zis_CompositeZgensZngensr   r
   r   r   r   propertyr   r   r   r   r   r   r   r   r   	   s    


r   N)r!   Zsympy.polys.domains.domainr   Zsympy.polys.polyerrorsr   Zsympy.utilitiesr   r   r   r   r   r   <module>   s    