[Python-checkins] python/dist/src/Lib random.py,1.51,1.52

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Tue Aug 5 06:23:21 EDT 2003


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv30058/Lib

Modified Files:
	random.py 
Log Message:
Removed deprecated functions

Index: random.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/random.py,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** random.py	24 Jun 2003 20:29:04 -0000	1.51
--- random.py	5 Aug 2003 12:23:18 -0000	1.52
***************
*** 46,51 ****
  __all__ = ["Random","seed","random","uniform","randint","choice","sample",
             "randrange","shuffle","normalvariate","lognormvariate",
!            "cunifvariate","expovariate","vonmisesvariate","gammavariate",
!            "stdgamma","gauss","betavariate","paretovariate","weibullvariate",
             "getstate","setstate","jumpahead"]
  
--- 46,51 ----
  __all__ = ["Random","seed","random","uniform","randint","choice","sample",
             "randrange","shuffle","normalvariate","lognormvariate",
!            "expovariate","vonmisesvariate","gammavariate",
!            "gauss","betavariate","paretovariate","weibullvariate",
             "getstate","setstate","jumpahead"]
  
***************
*** 309,335 ****
          return _exp(self.normalvariate(mu, sigma))
  
- ## -------------------- circular uniform --------------------
- 
-     def cunifvariate(self, mean, arc):
-         """Circular uniform distribution.
- 
-         mean is the mean angle, and arc is the range of the distribution,
-         centered around the mean angle.  Both values must be expressed in
-         radians.  Returned values range between mean - arc/2 and
-         mean + arc/2 and are normalized to between 0 and pi.
- 
-         Deprecated in version 2.3.  Use:
-             (mean + arc * (Random.random() - 0.5)) % Math.pi
- 
-         """
-         # mean: mean angle (in radians between 0 and pi)
-         # arc:  range of distribution (in radians between 0 and pi)
-         import warnings
-         warnings.warn("The cunifvariate function is deprecated; Use (mean "
-                       "+ arc * (Random.random() - 0.5)) % Math.pi instead",
-                       DeprecationWarning)
- 
-         return (mean + arc * (self.random() - 0.5)) % _pi
- 
  ## -------------------- exponential distribution --------------------
  
--- 309,312 ----
***************
*** 466,490 ****
              return x * beta
  
- 
-     def stdgamma(self, alpha, ainv, bbb, ccc):
-         # This method was (and shall remain) undocumented.
-         # This method is deprecated
-         # for the following reasons:
-         # 1. Returns same as .gammavariate(alpha, 1.0)
-         # 2. Requires caller to provide 3 extra arguments
-         #    that are functions of alpha anyway
-         # 3. Can't be used for alpha < 0.5
- 
-         # ainv = sqrt(2 * alpha - 1)
-         # bbb = alpha - log(4)
-         # ccc = alpha + ainv
-         import warnings
-         warnings.warn("The stdgamma function is deprecated; "
-                       "use gammavariate() instead",
-                       DeprecationWarning)
-         return self.gammavariate(alpha, 1.0)
- 
- 
- 
  ## -------------------- Gauss (faster alternative) --------------------
  
--- 443,446 ----
***************
*** 756,760 ****
      _test_generator(N, 'normalvariate(0.0, 1.0)')
      _test_generator(N, 'lognormvariate(0.0, 1.0)')
-     _test_generator(N, 'cunifvariate(0.0, 1.0)')
      _test_generator(N, 'vonmisesvariate(0.0, 1.0)')
      _test_generator(N, 'gammavariate(0.01, 1.0)')
--- 712,715 ----
***************
*** 787,795 ****
  normalvariate = _inst.normalvariate
  lognormvariate = _inst.lognormvariate
- cunifvariate = _inst.cunifvariate
  expovariate = _inst.expovariate
  vonmisesvariate = _inst.vonmisesvariate
  gammavariate = _inst.gammavariate
- stdgamma = _inst.stdgamma
  gauss = _inst.gauss
  betavariate = _inst.betavariate
--- 742,748 ----





More information about the Python-checkins mailing list