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?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python.list@tim.thechases.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:module': 0.04; 'backwards': 0.07; '(rather': 0.09; 'subject:python': 0.10; 'am,': 0.12; 'broken': 0.12; 'tries': 0.15; '-tkc': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'iterator': 0.16; 'message- id:@tim.thechases.com': 0.16; 'python2.6': 0.16; 'received:50': 0.16; 'received:70.251': 0.16; 'received:dsl.rcsntx.swbell.net': 0.16; 'received:rcsntx.swbell.net': 0.16; 'received:swbell.net': 0.16; 'subject:between': 0.16; 'subject:random': 0.16; 'umpteen': 0.16; 'zipfile': 0.16; 'cc:addr:python-list': 0.16; "wouldn't": 0.17; 'solution.': 0.17; 'wrote:': 0.18; 'alternate': 0.18; 'cc:no real name:2**0': 0.21; 'file,': 0.21; 'header:In-Reply-To:1': 0.22; 'cc:2**0': 0.26; 'code.': 0.26; 'module': 0.26; 'code': 0.26; 'cc:addr:python.org': 0.29; 'subject:?': 0.31; 'actually': 0.31; 'version': 0.32; 'source': 0.32; "i've": 0.32; 'ideal': 0.32; 'idea': 0.32; 'header:User-Agent:1': 0.33; 'it.': 0.33; 'file': 0.34; '2.4': 0.34; 'however,': 0.35; '...': 0.35; 'moving': 0.35; 'project': 0.35; 'some': 0.38; 'doing': 0.38; 'data': 0.38; 'might': 0.40; 'your': 0.61; 'course,': 0.62; 'aaron': 0.67; 'production': 0.71; '09:57': 0.84; 'conditions,': 0.93
Date Mon, 06 Feb 2012 13:26:42 -0600
From Tim Chase <python.list@tim.thechases.com>
User-Agent Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111120 Icedove/3.1.16
MIME-Version 1.0
To Aaron France <a.france.mailinglists@gmail.com>
Subject Re: difference between random module in python 2.6 and 3.2?
References <jgna4q$1t08$1@ns.felk.cvut.cz> <4f2f5081$0$29992$c3e8da3$5496439d@news.astraweb.com> <mailman.5464.1328504850.27778.python-list@python.org> <4f2f6b87$0$29992$c3e8da3$5496439d@news.astraweb.com> <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>
In-Reply-To <4F302088.8010901@gmail.com>
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 8bit
X-AntiAbuse This header was added to track abuse, please include it with any abuse report
X-AntiAbuse Primary Hostname - boston.accountservergroup.com
X-AntiAbuse Original Domain - python.org
X-AntiAbuse Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse Sender Address Domain - tim.thechases.com
X-Source
X-Source-Args
X-Source-Dir
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5483.1328556387.27778.python-list@python.org> (permalink)
Lines 24
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1328556387 news.xs4all.nl 6909 [2001:888:2000:d::a6]:35426
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:19906

Show key headers only | 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