
    ;e6                         d dl Zd dlZd dlZd dlZd dlZ G d dej                  Zedk    r ej	                     dS dS )    Nc                   n    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd ZdS )DictSetTestc                    t          i                                           }|                     t          |i            |                     t          |           t          i                                           }|                     t          |i            |                     t          |           t          i                                           }|                     t          |i            |                     t          |           d S N)typekeysassertRaises	TypeErroritemsvalues)selfktitvts       */usr/lib/python3.11/test/test_dictviews.pytest_constructors_not_callablez*DictSetTest.test_constructors_not_callable	   s    "''))__)R,,,)R((("((**)R,,,)R((("))++)R,,,)R(((((    c                    ddd}|                                 }|                     t          |          d           |                     t          |          ddh           |                     |ddh           |                     |h d           |                     |ddh           |                     |dh           |                     |d	           |                     d|           |                     d|           |                     d|           |                     d
|           |                     |                                 |                                            ddd}|                     |                                 |                                            |d= |                     |                                 |                                            d S )N
   ABC   a   r   r   >   r   br   r   *   Z   def)r   assertEquallensetassertNotEqualassertInassertNotIn)r   dr   es       r   test_dict_keyszDictSetTest.test_dict_keys   s   vvxxTA&&&TQH---3x(((D---000D1c(+++D1#&&&D"%%%ac4   T"""d###16688,,,16688,,,cFAFFHHaffhh/////r   c                 t   ddd}|                                 }|                     t          |          d           |                     t          |          ddh           |                     |ddh           |                     |h d           |                     |ddh           |                     |dh           |                     |d	           |                     d|           |                     d|           |                     d
|           |                     d|           |                     d|           |                     d|           |                     d|           |                     |                                 |                                            |                                }|                     |                                 |                                            d|d<   |                     |                                 |                                            d S )Nr   r   r   r   r   r   r   r   >   r+   r*   junk)r   r   r   )r   r   r    )r   )r   r      r   r   )r   r    r!   r"   r#   r$   r%   copy)r   r&   r   r'   s       r   test_dict_itemszDictSetTest.test_dict_items(   s   		UQ'''Ug|%<===, 7888E#B#B#BCCCEG\#:;;;EG9---E2&&&gu%%%lE***%(((E"""U###u%%%E***AGGII...FFHHAGGII...#AGGIIqwwyy11111r   c                    ddd}ddd}|                      |                                |                                           |                     |                                |                                           d S )Nr      ))r   r   )r   r   r   r   r   r   )r    r   r   r#   )r   r&   r'   s      r   test_dict_mixed_keys_itemsz&DictSetTest.test_dict_mixed_keys_items?   sl    $$aLL17799---AGGIIqvvxx00000r   c                     ddd}|                                 }|                     t          |          ddh           |                     t          |          d           d S )Nr   r   r   r   )r   r    r"   r!   )r   r&   r   s      r   test_dict_valueszDictSetTest.test_dict_valuesE   s^    Vr5k222Va(((((r   c                    ddd}|                      t          |          t                     t          |                                          }|                      |t                     |                     |dk    p|dk               t          |                                          }|                      |t                     |                     |dk    p|dk               t          |                                          }|                      |t                     |                     |dk    p|d	k               d S )
Nr   r   r   z#dict_items([('a', 'ABC'), (1, 10)])z#dict_items([(1, 10), ('a', 'ABC')])zdict_keys(['a', 1])zdict_keys([1, 'a'])zdict_values(['ABC', 10])zdict_values([10, 'ABC']))assertIsInstancereprstrr   
assertTruer   r   r   r&   rs      r   test_dict_reprzDictSetTest.test_dict_reprK   s:   d1ggs+++OOa%%%BB CBB	D 	D 	DNNa%%%22 322	4 	4 	4a%%%77 877	9 	9 	9 	9 	9r   c           	      `   ddd}ddd}ddd}d	di} G fd
dt                     |                     |                                |                                z  ddh           |                     |                                |                                z  dh           |                     |                                |                                z  t                                 |                     |                                t          |                                          z  ddh           |                     |                                t          |                                          z  dh           |                     |                                t          |                                          z  t                                 |                     |                                t          |                                          z  ddh           |                     |                                |                                z  d	h           |                     |                                |                                z  d	h           |                     |                                t          |                                          z  d	h           |                     |                                t          |                                          z  t                      |                     t          |                                          |                                z  t                      |                     t          |                                 |                                          z            t                      |                     t          |                                g z            t                      |                     t          g |                                z            t                      |                     |                                |                                z  ddh           |                     |                                |                                z  h d           |                     |                                |                                z  h d           |                     |                                t          |                                          z  ddh           |                     |                                t          |                                          z  h d           |                     |                                t          |                                          z  h d           |                     |                                dz  h d           |                     |                                |                                z  t                                 |                     |                                |                                z  ddh           |                     |                                |                                z  h d           |                     |                                t          |                                          z  t                                 |                     |                                t          |                                          z  ddh           |                     |                                t          |                                          z  h d           |                     |                                t          |                                          z  ddh           |                     |                                |                                z
  t                                 |                     |                                |                                z
  dh           |                     |                                |                                z
  ddh           |                     |                                t          |                                          z
  t                                 |                     |                                t          |                                          z
  dh           |                     |                                t          |                                          z
  ddh           |                     |                                dz
  ddh           |                     |                                	                    |                                                     |                     |                                	                    |                                                     |                     |                                	                    t          |                                                               |                     |                                	                    t          |                                                               |                     |                                	                    h d                     |                     |                                	                    g d                     |                     |                                	                    t          g d                               |                     |                                	                    t          ddg                               |                     |                                	                    ddg                     |                     |                                	                    i                      |                     |                                	                    |                                                     i }|                     |                                	                    t                                           |                     |                                	                    g                      |                     |                                	                    |                                                     |                     |                                	                    dg                     d S )Nr   r   r   r   r.   )r   c      r&   r'   r&   c                   "     e Zd Z fdZ xZS )7DictSetTest.test_keys_set_operations.<locals>.CustomSetc                 X     t                                          |                    S r   )superintersection)r   other	CustomSet	__class__s     r   rI   zDDictSetTest.test_keys_set_operations.<locals>.CustomSet.intersectionb   s%     y!5!5e!<!<===r   )__name__
__module____qualname__rI   __classcell__)rL   rK   s   @r   rK   rF   a   s>        > > > > > > > > > >r   rK   r   r   >   r   r   rA   >   r   r   r&   r'   r3   >   r   r   r   r   rA   )r   r   >   xyzrQ   rR   rS   rQ   rR   )r"   r    r   tupler8   	frozensetassertIsr   assertFalse
isdisjointlistr;   )r   d1d2d3d4derK   s         @r   test_keys_set_operationsz$DictSetTest.test_keys_set_operations[   s5
   1111X	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	RWWYY.c
;;;RWWYY.666RWWYY.666S^^3c3Z@@@S^^3cU;;;S^^3SUU;;;U27799%5%55SzBBBRWWYY.666RWWYY.666S^^3cU;;;bggii)BGGII*>*>>DDDi		22RWWYY>DDDd27799yy';';;<<cBBBd27799r>**C000d2		>**C000RWWYY.c
;;;RWWYY.@@@RWWYY.0D0D0DEEES^^3c3Z@@@S^^3___EEES^^3---	/ 	/ 	/V+-=-=-=>>>RWWYY.666RWWYY.c
;;;RWWYY.0D0D0DEEES^^3SUU;;;S^^3c3Z@@@S^^3---	/ 	/ 	/U27799%5%55SzBBBRWWYY.666RWWYY.666RWWYY.c
;;;S^^3SUU;;;S^^3cU;;;S^^3c3Z@@@V+c3Z888--bggii88999--bggii88999--d27799oo>>???--c"''))nn==>>>		,,___==>>>		,,___==>>>		,,S-A-ABBCCC		,,S#s__==>>>		,,c3Z88999		,,R00111		,,RWWYY77888		,,SUU33444		,,R00111		,,RWWYY77888		,,aS1122222r   c                    ddd}ddd}ddd}|                      |                                |                                z  ddh           |                      |                                |                                z  dh           |                      |                                |                                z  t                                 |                      |                                t          |                                          z  ddh           |                      |                                t          |                                          z  dh           |                      |                                t          |                                          z  t                                 |                      |                                |                                z  ddh           |                      |                                |                                z  h d	           |                      |                                |                                z  h d
           |                      |                                t          |                                          z  ddh           |                      |                                t          |                                          z  h d	           |                      |                                t          |                                          z  h d
           |                      |                                |                                z  t                                 |                      |                                |                                z  ddh           |                      |                                |                                z  h d
           |                      |                                |                                z
  t                                 |                      |                                |                                z
  dh           |                      |                                |                                z
  ddh           |                      |                                t          |                                          z
  t                                 |                      |                                t          |                                          z
  dh           |                      |                                t          |                                          z
  ddh           |                     |                                                    |                                                     |                     |                                                    |                                                     |                     |                                                    t          |                                                               |                     |                                                    t          |                                                               |                     |                                                    h d                     |                     |                                                    g d                     |                     |                                                    t          g d                               |                     |                                                    t          ddg                               |                     |                                                    i                      |                     |                                                    |                                                     i }|                     |                                                    t                                           |                     |                                                    g                      |                     |                                                    |                                                     |                     |                                                    dg                     d S )Nr   r   r@   rB   rC   rD   r   r   r   r   >   rb   r   r   rc   >   r&   rB   r'   rC   rb   rc   rd   >   rQ   rR   rS   rT   rQ   rR   )r    r   r"   rX   rY   rZ   r;   )r   r[   r\   r]   r_   s        r   test_items_set_operationsz%DictSetTest.test_items_set_operations   s;   111HHJJ#h%9	; 	; 	;bhhjj08*===bhhjj0#%%888c"((**oo5"H-	/ 	/ 	/c"((**oo5zBBBc"((**oo5suu===bhhjj0"H-	/ 	/ 	/bhhjj0777	9 	9 	9bhhjj0AAA	C 	C 	Cc"((**oo5"H-	/ 	/ 	/c"((**oo5777	9 	9 	9c"((**oo5AAA	C 	C 	C 	bhhjj0#%%888bhhjj0"H-	/ 	/ 	/bhhjj0AAA	C 	C 	C 	bhhjj0#%%888bhhjj08*===bhhjj08X2FGGGc"((**oo5suu===c"((**oo5zBBBc"((**oo5(7KLLL..rxxzz::;;;..rxxzz::;;;..tBHHJJ/?/?@@AAA..s288::??@@@

--ooo>>???

--ooo>>???

--c///.B.BCCDDD

--c3*oo>>???

--b11222

--bhhjj99:::

--cee44555

--b11222

--bhhjj99:::

--qc2233333r   c                 V   ddd}|                      |                                t          ddg          z  dh           |                      |                                t          ddg          z  h d           |                      |                                t          ddg          z  ddh           |                      |                                t          ddg          z
  dh           |                                }|                      |t          dg          z  dh           |                      |t          dg          z  dh           |                      |t          dg          z  ddh           |                      |t          dg          z
  dh           d S )	Nr   rB   )r   r.   r   >   r   r   r.   r.   r3   )r.   rB   )r    r   iterr   )r   originr   s      r   !test_set_operations_with_iteratorz-DictSetTest.test_set_operations_with_iterator   sw   1q!f5s;;;q!f5yyyAAAq!f51v>>>q!f5s;;;vh/&:::vh/&:::vh/&&1ABBBvh/&:::::r   c                    |                      t                    5  i                                 dz   d d d            n# 1 swxY w Y   |                      t                    5  i                                 dz   d d d            n# 1 swxY w Y   |                      t                    5  i                                 dz   d d d            n# 1 swxY w Y   |                      t                    5  i                                 dz
   d d d            n# 1 swxY w Y   |                      t                    5  i                                 dz   d d d            n# 1 swxY w Y   |                      t                    5  i                                 dz   d d d            n# 1 swxY w Y   |                      t                    5  i                                 dz   d d d            n# 1 swxY w Y   |                      t                    5  i                                 dz
   d d d            d S # 1 swxY w Y   d S )Nr   )r	   r
   r   r   r   s    r   $test_set_operations_with_noniterablez0DictSetTest.test_set_operations_with_noniterable   s   y)) 	 	GGIIMM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	y)) 	 	GGIIMM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	y)) 	 	GGIIMM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	y)) 	 	GGIIMM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 y)) 	 	HHJJNN	 	 	 	 	 	 	 	 	 	 	 	 	 	 	y)) 	 	HHJJNN	 	 	 	 	 	 	 	 	 	 	 	 	 	 	y)) 	 	HHJJNN	 	 	 	 	 	 	 	 	 	 	 	 	 	 	y)) 	 	HHJJNN	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   ?AA$BBB-CCC6DD!D?E##E'*E'F,,F03F0G55G9<G9H??IIc                    i }|                                 |d<   t          |          }|                     |t                     |                                |d<   t          |          }|                     |t                     d S )Nr   )r   r9   r8   r:   r   r<   s      r   test_recursive_reprzDictSetTest.test_recursive_repr   ss    

"GG 	a%%%		"GGa%%%%%r   c                     i }t          t          j                    dz             D ]}d|                                i}|                     t
          t          |           d S )Nd   r   )rangesysgetrecursionlimitr   r	   RecursionErrorr9   )r   r&   is      r   test_deeply_nested_reprz#DictSetTest.test_deeply_nested_repr  s^    s,..455 	! 	!AQXXZZ AA.$22222r   c                 `   ddd}|                      t          t          j        |                                           |                      t          t          j        |                                           |                      t          t          j        |                                           d S )Nr   r   r   )r	   r
   r/   r   r   r   r   r&   s     r   	test_copyzDictSetTest.test_copy  s{    )TY999)TY

;;;)TY		:::::r   c                     G d dt                      G fdd          } |             |            }} |             |            }}||i}|                     ||           |                     ||                                           |                     ||                                           |                     ||f|                                           |                     |j        |           |                     |                                j        |           |                     |                                j        ||f           |                     |                                j        ||f           |                               5  ||                                v  d d d            d S # 1 swxY w Y   d S )Nc                       e Zd ZdS )+DictSetTest.test_compare_error.<locals>.ExcN)rM   rN   rO   r-   r   r   Excr~     s        Dr   r   c                        e Zd Zd Z fdZdS )-DictSetTest.test_compare_error.<locals>.BadEqc                     dS )N   r-   rm   s    r   __hash__z6DictSetTest.test_compare_error.<locals>.BadEq.__hash__  s    qr   c                     r   r-   )r   rJ   r   s     r   __eq__z4DictSetTest.test_compare_error.<locals>.BadEq.__eq__  s    	r   N)rM   rN   rO   r   r   )r   s   r   BadEqr     s=                r   r   )	Exceptionr$   r   r   r   r	   __contains__)r   r   k1k2v1v2r&   r   s          @r   test_compare_errorzDictSetTest.test_compare_error  s   	 	 	 	 	) 	 	 		 	 	 	 	 	 	 	 	 	 %%''B%%''BHb!b!&&((###b!((**%%%r2h		***#q~r222#qvvxx4b999#qwwyy5Bx@@@#qwwyy5Bx@@@s## 	 	!((**	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   GG
Gc                    ddd}t          t          j        dz             D ]}|                     t          t          j        ft          j        |                                |           |                     t          t          j        ft          j        |                                |           |                     t          t          j        ft          j        |	                                |           d S )Nr   r   r   r   )
rs   pickleHIGHEST_PROTOCOLr	   r
   PicklingErrordumpsr   r   r   )r   r&   protos      r   test_picklezDictSetTest.test_pickle,  s    62Q677 	0 	0Ey&*>?affhh/ / /y&*>?ahhjj%1 1 1y&*>?aggii0 0 0 0	0 	0r   c                    t          d          }|                     |                                t          j        j                   |                     |                                t          j        j                   |                     |                                t          j        j                   |                     |                                t          j        j                   |                     |                                t          j        j	                   |                     |                                t          j        j
                   |                     |                                t          j        j                   |                     |                                t          j        j                   |                     |                                t          j        j                   |                     |                                t          j        j                   |                     |                                t          j        j	                   |                     |                                t          j        j
                   |                     |                                t          j        j                   |                     |                                t          j        j                   |                     |                                t          j        j                   |                     |                                t          j        j                   |                     |                                t          j        j	                   |                     |                                t          j        j
                   d S )Nr   )r   )dictr8   r   collectionsabcKeysViewMappingViewSetSizedIterable	Containerr   
ValuesView
Collectionr   	ItemsViewrz   s     r   test_abc_registryzDictSetTest.test_abc_registry6  s   1IIIaffhh(@AAAaffhh(CDDDaffhh(;<<<affhh(=>>>affhh(@AAAaffhh(ABBBahhjj+/*DEEEahhjj+/*EFFFahhjj+/*?@@@ahhjj+/*DEEEahhjj+/*BCCCahhjj+/*CDDDaggii)BCCCaggii)DEEEaggii)<===aggii)>???aggii)ABBBaggii)BCCCCCr   N)rM   rN   rO   r   r(   r0   r4   r6   r>   r`   rg   rk   rn   rp   rx   r{   r   r   r   r-   r   r   r   r      s       	) 	) 	)0 0 0(2 2 2.1 1 1) ) )9 9 9 D3 D3 D3L64 64 64p; ; ;  && & &3 3 3; ; ;  40 0 0D D D D Dr   r   __main__)
collections.abcr   r/   r   rt   unittestTestCaser   rM   mainr-   r   r   <module>r      s          



 ED ED ED ED ED(# ED ED EDP
 zHMOOOOO r   