o
    jgj  ã                   @   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   ú[/var/www/html/zoom/venv/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©Úsymsetr   r   Ú	<genexpr>   s   € z'CompositeDomain.drop.<locals>.<genexpr>)r   Útupler   r
   Údropr	   r   )r   r   Ú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__Úis_CompositeÚgensÚngensr   r
   r   r   r   Úpropertyr   r   r   r   r   r   r   r   r   	   s    


r   N)r#   Úsympy.polys.domains.domainr   Úsympy.polys.polyerrorsr   Úsympy.utilitiesr   r   r   r   r   r   Ú<module>   s    