[Python-checkins] python/nondist/sandbox/twister _random.c,1.6,1.7

rhettinger@users.sourceforge.net rhettinger@users.sourceforge.net
2002年12月28日 13:16:39 -0800


Update of /cvsroot/python/python/nondist/sandbox/twister
In directory sc8-pr-cvs1:/tmp/cvs-serv32531
Modified Files:
	_random.c 
Log Message:
Minor adjustments. Fix type in comment. Replace PyArg_ParseTuple
with cleaner PyArg_UnpackTuple.
Index: _random.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/twister/_random.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** _random.c	26 Dec 2002 05:14:33 -0000	1.6
--- _random.c	28 Dec 2002 21:16:37 -0000	1.7
***************
*** 214,218 ****
 	long hash;
 
! 	if (!PyArg_ParseTuple(args, "|O:seed", &arg))
 		return NULL;
 
--- 214,218 ----
 	long hash;
 
! 	if (!PyArg_UnpackTuple(args, "seed", 0, 1, &arg))
 		return NULL;
 
***************
*** 352,357 ****
 state elements ought to produce a state which would not be encountered
 (in the near term) by calls to random(). Shuffling is normally
! implementing by swapping the ith element with another element ranging
! from 0 to i inclusive.	That allows the element to have the possibility
 of not being moved. Since the goal is to produce a new, different
 state, the swap element is ranged from 0 to i-1 inclusive. This assures
--- 352,357 ----
 state elements ought to produce a state which would not be encountered
 (in the near term) by calls to random(). Shuffling is normally
! implemented by swapping the ith element with another element ranging
! from 0 to i inclusive. That allows the element to have the possibility
 of not being moved. Since the goal is to produce a new, different
 state, the swap element is ranged from 0 to i-1 inclusive. This assures

AltStyle によって変換されたページ (->オリジナル) /