
    2hho	                         S r SSKrSSKr\R                  R                  S:  a  \R
                  " S5      e " S S\5      r " S S\R                  5      r	SS	K
7  \S
:X  a  \R                  " 5         gg)u   A module to test whether doctest recognizes some 2.2 features,
like static and class methods.

>>> print('yup')  # 1
yup

We include some (random) encoded (utf-8) text in the text surrounding
the example.  It should be ignored:

ЉЊЈЁЂ

    N   zCannot test docstrings with -O2c                   v    \ rS rSrSrS rS r " S S\5      rS r	S r
\" \	\
S	S
9r\S 5       r\S 5       rSrg)C   u   Class C.

>>> print(C())  # 2
42


We include some (random) encoded (utf-8) text in the text surrounding
the example.  It should be ignored:

    ЉЊЈЁЂ

c                     g)z#C.__init__.

>>> print(C()) # 3
42
N selfs    H/opt/python-3.13.8/usr/lib/python3.13/test/test_doctest/test_doctest2.py__init__
C.__init__!           c                     g)z
>>> print(C()) # 4
42
42r   r	   s    r   __str__	C.__str__(   s    
 r   c                       \ rS rSrSrS rSrg)C.D/   z2A nested D class.

>>> print("In D!")   # 5
In D!
c                     g)z
>>> print(3) # 6
3
Nr   r	   s    r   nested
C.D.nested6   r   r   r   N)__name__
__module____qualname____firstlineno____doc__r   __static_attributes__r   r   r   Dr   /   s    		r   r    c                     U R                   * $ )z?
>>> c = C()    # 7
>>> c.x = 12   # 8
>>> print(c.x)  # 9
-12
_xr	   s    r   getxC.getx<   s     xr   c                     Xl         g)zE
>>> c = C()     # 10
>>> c.x = 12    # 11
>>> print(c.x)   # 12
-12
Nr"   )r
   values     r   setxC.setxE   s	     r   zi        >>> c = C()    # 13
        >>> c.x = 12   # 14
        >>> print(c.x)  # 15
        -12
        )docc                      g)zU
A static method.

>>> print(C.statm())    # 16
666
>>> print(C().statm())  # 17
666
i  r   r   r   r   statmC.statmU   s     r   c                     U$ )zT
A class method.

>>> print(C.clsm(22))    # 18
22
>>> print(C().clsm(23))  # 19
23
r   )clsvals     r   clsmC.clsma   s	     
r   r"   N)r   r   r   r   r   r   r   objectr    r$   r(   propertyxstaticmethodr,   classmethodr1   r   r   r   r   r   r      sd    F  	t " 	A 	 	 	 	r   r   c                       \ rS rSrS rSrg)Testn   c                     SS K nSS KnSnUR                  UR                  [           5      u  pEU(       a  U R                  SXE4-  5        XS:w  a  U R                  SX54-  5        g g )Nr   r   z%d of %d doctests failedz expected %d tests to run, not %d)doctestsystestmodmodulesr   fail)r
   r<   r=   EXPECTEDfts         r   test_testmodTest.test_testmodo   sX    s{{845II0A69:=II8H=HI r   r   N)r   r   r   r   rD   r   r   r   r   r9   r9   n   s    Jr   r9   )*__main__)r   r=   unittestflagsoptimizeSkipTestr3   r   TestCaser9   r<   r   mainr   r   r   <module>rN      st     99


=
>>X XvJ8 J zMMO r   