Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!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.066 X-Spam-Evidence: '*H*': 0.88; '*S*': 0.01; 'subject:string': 0.09; 'def': 0.12; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'roy': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'initial': 0.24; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'getting': 0.31; "can't": 0.35; 'received:209.85': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'skip:" 50': 0.36; 'received:209': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'space': 0.40; 'smith': 0.68; 'optimum': 0.93; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=rXaadCYAuCLDcv4ZXt6lANIH0D/+7ZbpeKmddHR490g=; b=qgJeIJaq7RlVo3KzhhSiT/6V1vnlfJwfyowvEWtgZDCBl9c6t02UaSylfmw69PfF1e R/ZfT4+5YlzyVmfaur72U+VsRlTObb7kzg2i/dP2hXTAP/EZXnzg4AkJjjhipAgfUU2Z F3RnMXOnOO0oSP5v9B207ElAEbuhl8jExsOeVeNmIOgdeI94cqVJyIPGORo6ntWlH1CQ XLnjHSrhzCVr0jhG1j2VHSRlaoXtvJ845DPToKVpEbyGNpYoF/VEBSWcN+5Em8uWUUii SXFsZ9GXrB413ovmszcrDEal6PoXOqJ2QWaTI/MG2XExKqZeFC9Sxm8JDM+2hTi893/X qNXw== MIME-Version: 1.0 X-Received: by 10.52.111.130 with SMTP id ii2mr13953993vdb.111.1365438017395; Mon, 08 Apr 2013 09:20:17 -0700 (PDT) In-Reply-To: References: <5161e996$0$29995$c3e8da3$5496439d@news.astraweb.com> Date: Tue, 9 Apr 2013 02:20:17 +1000 Subject: Re: Splitting of string at an interval From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1365438020 news.xs4all.nl 6945 [2001:888:2000:d::a6]:49719 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:43082 On Tue, Apr 9, 2013 at 1:37 AM, Roy Smith wrote: > I can't help point out, however, that if your initial implementation is to have your code return a constant, it's pretty likely to be an optimum solution in both time and space :-) Likely, but not certain. # 1 def fifty_stars(): return "**************************************************" # 2 fifty_stars=lambda "*"*50 Okay, that's just getting 2AM stupid now. :) ChrisA