a
    kº”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   úQ/var/www/auris/lib/python3.9/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   | ]}|ˆ vr|V  qd S ©Nr   )Ú.0Ús©Zsymsetr   r   Ú	<genexpr>   ó    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
   