Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/test_fractions.cpython-311.opt-1.pyc |
�
�Ke�� � �P � d Z ddlmZ ddlmZ ddlZddlZddlZddlZddl Z ddl
Z
ddlZddlZddl
m
Z
mZ ddlZddlmZmZ ej Z G d� de� � Z G d � d
e� � Z G d� dej � � Zd
� Z G d� dej � � Zedk r ej � � dS dS )zTests for Lib/fractions.py.� )�Decimal)�requires_IEEE_754N)�copy�deepcopy)�dumps�loadsc �L � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z
d � Zd
� ZeZ
dS )�
DummyFloatz8Dummy float class for testing comparisons with Fractionsc �\ � t |t � � st d� � �|| _ d S )Nz-DummyFloat can only be initialized from float)�
isinstance�float� TypeError�value��selfr s �=/usr/local/apps/python3/lib/python3.11/test/test_fractions.py�__init__zDummyFloat.__init__ s/ � ��%��'�'� M��K�L�L�L���
�
�
� c �� � t |t j � � r) |t � | j � � |� � S t |t � � r || j |j � � S t S �N)r �numbers�Rational�F�
from_floatr r
�NotImplemented)r �other�ops r �_richcmpzDummyFloat._richcmp se � ��e�W�-�.�.� "��2�a�l�l�4�:�.�.��6�6�6�
��z�
*�
*� "��2�d�j�%�+�.�.�.�!�!r c �B � | � |t j � � S r )r �operator�eq�r r s r �__eq__zDummyFloat.__eq__# � � �D�M�M�%���$E�$E�Er c �B � | � |t j � � S r )r r �ler"