Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: =?UTF-8?Q?Nagy_L=c3=a1szl=c3=b3_Zsolt?= Newsgroups: comp.lang.python Subject: Re: I'm wrong or Will we fix the ducks limp? Date: Fri, 3 Jun 2016 18:11:12 +0200 Lines: 30 Message-ID: References: <46f79572-b9ae-4898-13b4-97c2c5589e45@shopzeus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de ROBjZeMfPixvkvaf6N5GwAvboRkSdDNu1XpIm973Xdvw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '"""': 0.05; 'filename': 0.07; '"""get': 0.09; 'filename)': 0.09; 'parsed': 0.09; 'files.': 0.13; 'def': 0.13; 'iterable': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'meetings': 0.18; 'all,': 0.20; 'advance.': 0.23; 'header:In-Reply-To:1': 0.24; 'yield': 0.27; 'objects': 0.29; 'skip:[ 10': 0.31; 'file': 0.34; 'list': 0.34; 'exist': 0.35; 'skip:p 30': 0.35; 'but': 0.36; 'list,': 0.36; 'instead': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; "won't": 0.38; 'files': 0.38; 'subject:the': 0.39; 'to:addr:python.org': 0.40; 'determine': 0.61; 'charset:windows-1252': 0.62; 'construct': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shopzeus.com; s=shopzeus_com; t=1464970270; bh=MkrkBnvuqI+d+CeiKl5c88JWufZI186Q4Q5Ikx2Xvk0=; h=Subject:To:References:From:Date:In-Reply-To:From; b=MRrNW9X2QPXiH314KFcH0YvPFd4IxX0vHNznI8DKbgrXMiSEZuu7QKSOh2sNfOWvm nQQdxfiRWGNQ3rJAmMV64fXv1v5mNKASeoXEJ4sLtUT+3+9MwlotEwVQyk+nfc520s nEdvNtuBCqaY4SK3AG3n1FfKKdSpnsc0UoXthLEwRtynd/MNDXsquitYbWr47S6TpL PUkemeMrzbmmgyuu0f6Srgg7beciCkwFOaWK+IPfdWO/wUTqiojbDM2/gTOl1OJYcv z11m22gl3zL2Ouz78GLCm4MFa1bNC6A3NvDrmm+FMka6ijb7jIFh/6hCfOZRc4cMF/ sLKEHMc1DIRmQ== In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <46f79572-b9ae-4898-13b4-97c2c5589e45@shopzeus.com> X-Mailman-Original-References: Xref: csiph.com comp.lang.python:109428 > def getsMeet(files=file_list): > """Get a File or List of Files. > > From the list of files determine > what meetings exist and prepare them > to be parsed > """ > pyqFiles = [] > for filename in sorted(file_list): > pyqFiles = pyqFiles.append(pq(filename=my_dir + filename)) > > return pyqFiles This may not be the answer you are seeking, but how about: def getsMeet(files=file_list): return [pq(filename=my_dir + filename) for filename in sorted(file_list)] If you can use any iterable instead of a list, then you can also consider using a generator: def getsMeet(files=file_list): for filename in sorted(file_list): yield pq(filename=my_dir + filename) for pg_obj in getsMeet(my_file_list): process(pg_obj) This way you do not need to construct a list at all, and it won't create all pq objects in advance.