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: 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 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 Subject: Re: difference between random module in python 2.6 and 3.2? References: <4f2f5081$0$29992$c3e8da3$5496439d@news.astraweb.com> <4f2f6b87$0$29992$c3e8da3$5496439d@news.astraweb.com> <4f2f89d7$0$29992$c3e8da3$5496439d@news.astraweb.com> <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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 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