Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #19906

Re: difference between random module in python 2.6 and 3.2?

Date 2012-02-06 13:26 -0600
From Tim Chase <python.list@tim.thechases.com>
Subject Re: difference between random module in python 2.6 and 3.2?
References (4 earlier) <mailman.5469.1328513256.27778.python-list@python.org> <4f2f89d7$0$29992$c3e8da3$5496439d@news.astraweb.com> <jgo3pp$269s$1@ns.felk.cvut.cz> <jgo4fg$26h9$1@ns.felk.cvut.cz> <4F302088.8010901@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.5483.1328556387.27778.python-list@python.org> (permalink)

Show all headers | View raw


On 02/06/12 12:48, Aaron France wrote:
> On 02/06/2012 09:57 AM, Matej Cepl wrote:
>> Silly, of course, the solution is obvious ... I have just
>> embedded random.choice from 2.6 to my code.
>>
>> Matěj
> Is the above actually a good idea though?
>
> What I understand you're doing is embedding the source from
> the Python2.6 random.py file, /into/ your project files?

In an ideal world, the code wouldn't have broken backwards 
compat.  However, given the conditions, if Matej is willing to 
forgo bug-fixes, it's a reasonable solution.  The alternate might 
be to try moving the recent/fixed version into the old project 
and updating tests/data to work with it.  I have some 2.4 
production code in which I've pulled 2.6's zipfile module in to 
give access to the iterator access (rather than the .read() 
method which tries to read in umpteen gigs of data that I just 
want to spool out to a file on disk).

-tkc

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

difference between random module in python 2.6 and 3.2? Matej Cepl <mcepl@redhat.com> - 2012-02-06 02:27 +0100
  Re: difference between random module in python 2.6 and 3.2? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-06 04:01 +0000
    Re: difference between random module in python 2.6 and 3.2? Terry Reedy <tjreedy@udel.edu> - 2012-02-06 00:07 -0500
      Re: difference between random module in python 2.6 and 3.2? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-06 05:56 +0000
        Re: difference between random module in python 2.6 and 3.2? Terry Reedy <tjreedy@udel.edu> - 2012-02-06 02:27 -0500
          Re: difference between random module in python 2.6 and 3.2? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-06 08:05 +0000
            Re: difference between random module in python 2.6 and 3.2? Matej Cepl <mcepl@redhat.com> - 2012-02-06 09:45 +0100
              Re: difference between random module in python 2.6 and 3.2? Matej Cepl <mcepl@redhat.com> - 2012-02-06 09:57 +0100
                Re: difference between random module in python 2.6 and 3.2? Tim Chase <python.list@tim.thechases.com> - 2012-02-06 13:26 -0600
                Re: difference between random module in python 2.6 and 3.2? Matej Cepl <mcepl@redhat.com> - 2012-02-06 23:06 +0100
                Re: difference between random module in python 2.6 and 3.2? Serhiy Storchaka <storchaka@gmail.com> - 2012-02-07 12:05 +0200
              Re: difference between random module in python 2.6 and 3.2? Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2012-02-07 16:11 +0100
            Re: difference between random module in python 2.6 and 3.2? Mel Wilson <mwilson@the-wire.com> - 2012-02-06 10:20 -0500

csiph-web