U
    L?hj                     @   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 dS )z%Inject generators into this domain.  zcommon generators in %s and %sN)setsymbols	__class__domainorderr   )selfr    r   U/var/www/html/venv/lib/python3.8/site-packages/sympy/polys/domains/compositedomain.pyinject   s    zCompositeDomain.injectc                    sH   t | t fdd| jD }| jj| }|s4|S | ||| jS dS )z"Drop generators from this domain. c                 3   s   | ]}| kr|V  qd S Nr   ).0sZsymsetr   r   	<genexpr>   s      z'CompositeDomain.drop.<locals>.<genexpr>N)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   s   | 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   s   | j jS 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
   