config root man

Current Path : /compat/linux/proc/self/root/usr/local/lib/python2.5/test/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //compat/linux/proc/self/root/usr/local/lib/python2.5/test/test_binop.pyo

³ò
h”Rc@s dZddkZddklZd„Zd„Zd„Zd„Zdefd	„ƒYZ	d
ei
fd„ƒYZdZd
„Z
edjoe
ƒndS(s9Tests for binary operators on subtypes of built-in types.iÿÿÿÿN(ttest_supportcCs$x|o|||}}qW|S(s1Greatest common divisor using Euclid's algorithm.((tatb((s+/usr/local/lib/python2.5/test/test_binop.pytgcdscCst|tƒp
t|tƒS(s5Test whether an object is an instance of int or long.(t
isinstancetinttlong(tx((s+/usr/local/lib/python2.5/test/test_binop.pytisintscCs9x2ttttfD]}t||ƒodSqqWdS(sATest whether an object is an instance of a built-in numeric type.ii(RRtfloattcomplexR(RtT((s+/usr/local/lib/python2.5/test/test_binop.pytisnums
cCs
t|tƒS(s6Test wheter an object is an instance of the Rat class.(RtRat(R((s+/usr/local/lib/python2.5/test/test_binop.pytisRatsR
cBseZdZddgZddd„Zd„ZeedƒZd„Z	ee	dƒZ
d„Zd	„Zd
„Z
d„Zd„Zd
„ZeZd„Zd„Zd„ZeZd„ZeZd„ZeZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!RS(s:Rational number implemented as a normalized pair of longs.t	_Rat__numt	_Rat__denllcCst|ƒptd|‚nt|ƒptd|‚n|djo
td‚nt||ƒ}t||ƒ|_t||ƒ|_dS(sdConstructor: Rat([num[, den]]).

        The arguments must be ints or longs, and default to (0, 1).s&Rat numerator must be int or long (%r)s(Rat denominator must be int or long (%r)iszero denominatorN(Rt	TypeErrortZeroDivisionErrorRRRR(tselftnumtdentg((s+/usr/local/lib/python2.5/test/test_binop.pyt__init__!s



cCs|iS(s7Accessor function for read-only 'num' attribute of Rat.(R(R((s+/usr/local/lib/python2.5/test/test_binop.pyt_get_num0scCs|iS(s7Accessor function for read-only 'den' attribute of Rat.(R(R((s+/usr/local/lib/python2.5/test/test_binop.pyt_get_den5scCsd|i|ifS(s=Convert a Rat to an string resembling a Rat constructor call.sRat(%d, %d)(RR(R((s+/usr/local/lib/python2.5/test/test_binop.pyt__repr__:scCstt|ƒƒS(s=Convert a Rat to a string resembling a decimal numeric value.(tstrR	(R((s+/usr/local/lib/python2.5/test/test_binop.pyt__str__>scCs|id|iS(sConvert a Rat to a float.gð?(RR(R((s+/usr/local/lib/python2.5/test/test_binop.pyt	__float__BscCse|idjo>yt|iƒSWqNtj
otdt|ƒ‚qNXntdt|ƒ‚dS(s,Convert a Rat to an int; self.den must be 1.is%s too large to convert to intscan't convert %s to intN(RRRt
OverflowErrortreprt
ValueError(R((s+/usr/local/lib/python2.5/test/test_binop.pyt__int__FscCs8|idjot|iƒSntdt|ƒ‚dS(s-Convert a Rat to an long; self.den must be 1.iscan't convert %s to longN(RRRR R(R((s+/usr/local/lib/python2.5/test/test_binop.pyt__long__PscCs€t|ƒot|ƒ}nt|ƒo3t|i|i|i|i|i|iƒSnt|ƒot|ƒ|SntS(s$Add two Rats, or a Rat and a number.(RR
RRRRR	tNotImplemented(Rtother((s+/usr/local/lib/python2.5/test/test_binop.pyt__add__Vs


cCs€t|ƒot|ƒ}nt|ƒo3t|i|i|i|i|i|iƒSnt|ƒot|ƒ|SntS(s)Subtract two Rats, or a Rat and a number.(RR
RRRRR	R#(RR$((s+/usr/local/lib/python2.5/test/test_binop.pyt__sub__cs


cCs€t|ƒot|ƒ}nt|ƒo3t|i|i|i|i|i|iƒSnt|ƒo|t|ƒSntS(s9Subtract two Rats, or a Rat and a number (reversed args).(RR
RRRRR	R#(RR$((s+/usr/local/lib/python2.5/test/test_binop.pyt__rsub__ns


cCs}t|ƒo%t|i|i|i|iƒSnt|ƒot|i||iƒSnt|ƒot|ƒ|SntS(s)Multiply two Rats, or a Rat and a number.(RR
RRRRR	R#(RR$((s+/usr/local/lib/python2.5/test/test_binop.pyt__mul__ys
%

cCs}t|ƒo%t|i|i|i|iƒSnt|ƒot|i|i|ƒSnt|ƒot|ƒ|SntS(s'Divide two Rats, or a Rat and a number.(RR
RRRRR	R#(RR$((s+/usr/local/lib/python2.5/test/test_binop.pyt__truediv__…s
%

cCs}t|ƒo%t|i|i|i|iƒSnt|ƒot||i|iƒSnt|ƒo|t|ƒSntS(s7Divide two Rats, or a Rat and a number (reversed args).(RR
RRRRR	R#(RR$((s+/usr/local/lib/python2.5/test/test_binop.pyt__rtruediv__‘s
%

cCsJt|ƒot|ƒ}nt|ƒptSn||}|i|iS(s.Divide two Rats, returning the floored result.(RR
RR#RR(RR$R((s+/usr/local/lib/python2.5/test/test_binop.pyt__floordiv__s


cCs||}|i|iS(s>Divide two Rats, returning the floored result (reversed args).(RR(RR$R((s+/usr/local/lib/python2.5/test/test_binop.pyt
__rfloordiv__¦s
cCsNt|ƒot|ƒ}nt|ƒptSn||}||||fS(s2Divide two Rats, returning quotient and remainder.(RR
RR#(RR$R((s+/usr/local/lib/python2.5/test/test_binop.pyt
__divmod__«s


cCs?t|ƒot|ƒ}nt|ƒptSnt||ƒS(sBDivide two Rats, returning quotient and remainder (reversed args).(RR
RR#tdivmod(RR$((s+/usr/local/lib/python2.5/test/test_binop.pyt__rdivmod__´s


cCst||ƒdS(sTake one Rat modulo another.i(R.(RR$((s+/usr/local/lib/python2.5/test/test_binop.pyt__mod__¼scCst||ƒdS(s,Take one Rat modulo another (reversed args).i(R.(RR$((s+/usr/local/lib/python2.5/test/test_binop.pyt__rmod__ÀscCs‡t|ƒo!|idjo
|i|jSnt|ƒo'|i|ijo|i|ijSnt|ƒot|ƒ|jSntS(sCompare two Rats for equality.i(RRRRRR	R#(RR$((s+/usr/local/lib/python2.5/test/test_binop.pyt__eq__Äs
!
'
cCs||jS(s Compare two Rats for inequality.((RR$((s+/usr/local/lib/python2.5/test/test_binop.pyt__ne__ÎsN("t__name__t
__module__t__doc__t	__slots__RRtpropertytNoneRRRRRRR!R"R%t__radd__R&R'R(t__rmul__R)t__div__R*t__rdiv__R+R,R-R/R0R1R2R3(((s+/usr/local/lib/python2.5/test/test_binop.pyR
s<						
					
	
	
									
tRatTestCasecBs_eZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„ZRS(
s3Unit tests for Rat class and its support utilities.cCs[|itddƒdƒ|itddƒdƒ|itddƒdƒ|itddƒdƒ|itd	dƒd
ƒ|itdd
ƒdƒ|itd	d
ƒd
ƒx¥tddƒD]”}x‹tddƒD]z}|it||ƒdjƒ|it||ƒdjƒ|it||ƒdjƒ|it||ƒdjƒqÕWq¿WdS(
Ni
iiiiiiidiöÿÿÿiþÿÿÿii(tassertEqualRtrangetassert_(Rtitj((s+/usr/local/lib/python2.5/test/test_binop.pyttest_gcdÕsc
Cstddƒ}|i|idƒ|i|idƒtddƒ}|i|idƒ|i|idƒtddƒ}|i|idƒ|i|idƒtd	dƒ}|i|idƒ|i|idƒtd	dƒ}|i|idƒ|i|idƒtd
ƒ}|i|id
ƒ|i|idƒytddƒ}Wntj
onX|id
ƒxšddddghdttf	D]w}yt|ƒ}Wntj
onX|id|ƒytd|ƒ}Wntj
oq“X|id|ƒq“WdS(Ni
iiil
liñÿÿÿiþÿÿÿiöÿÿÿiiis(Rat(1, 0) didn't raise ZeroDivisionErrort0gysRat(%r) didn't raise TypeErrors!Rat(1, %r) didn't raise TypeError((	R
R?RRRtfailR9tunittestR(RRtbad((s+/usr/local/lib/python2.5/test/test_binop.pyttest_constructoräsF
"cCs°|itddƒtddƒdƒ|itddƒdtddƒƒ|idtddƒtddƒƒ|idtddƒdƒ|itddƒddƒdS(Niiiigð?gø?(R?R
(R((s+/usr/local/lib/python2.5/test/test_binop.pyttest_adds
&&&cCs¹|itddƒtddƒtddƒƒ|itddƒdtddƒƒ|idtddƒtddƒƒ|itddƒdd	ƒ|idtddƒd	ƒdS(
Niiiii
iigð?gà?(R?R
(R((s+/usr/local/lib/python2.5/test/test_binop.pyttest_subs
/&&cCs§|itddƒtddƒtddƒƒ|itddƒddƒ|idtddƒdƒ|itddƒddƒ|idtddƒdƒdS(	Niiiii
igà?gð?(R?R
(R((s+/usr/local/lib/python2.5/test/test_binop.pyttest_muls
/cCs¶|itddƒtddƒtddƒƒ|itddƒdtddƒƒ|idtdƒtddƒƒ|idtd	dƒd
ƒ|itd	dƒdd
ƒdS(Ni
iiiii	ig@igø?(R?R
(R((s+/usr/local/lib/python2.5/test/test_binop.pyttest_div s
/&#cCs~|itdƒtdƒdƒ|itddƒtddƒdƒ|itdƒddƒ|idtdƒdƒdS(Ni
iii(R?R
(R((s+/usr/local/lib/python2.5/test/test_binop.pyt
test_floordiv's &cCs{|itdƒtddƒƒ|itdƒdƒ|idtdƒƒ|itdƒdƒ|idtdƒƒdS(Ni
iig$@(R?R
(R((s+/usr/local/lib/python2.5/test/test_binop.pyttest_eq-s
cBsedUdS(N(tfuture_test(R((s+/usr/local/lib/python2.5/test/test_binop.pyttest_future_div4s(R4R5R6RDRIRJRKRLRMRNRORQ(((s+/usr/local/lib/python2.5/test/test_binop.pyR>Òs		'						s
from __future__ import division
self.assertEqual(Rat(10, 3) / Rat(5, 7), Rat(14, 3))
self.assertEqual(Rat(10, 3) / 3, Rat(10, 9))
self.assertEqual(2 / Rat(5), Rat(2, 5))
self.assertEqual(3.0 * Rat(1, 2), 1.5)
self.assertEqual(Rat(1, 2) * 3.0, 1.5)
self.assertEqual(eval('1/2'), 0.5)
cCstitƒdS(N(Rtrun_unittestR>(((s+/usr/local/lib/python2.5/test/test_binop.pyt	test_mainCst__main__(R6RGttestRRRRRtobjectR
tTestCaseR>RPRSR4(((s+/usr/local/lib/python2.5/test/test_binop.pys<module>s				·o	


Man Man