Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eweka.nl!lightspeed.eweka.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3.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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.06; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:string': 0.09; 'checking,': 0.16; 'impractical': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:raw': 0.16; 'timestamp': 0.16; 'wrote:': 0.18; 'obviously': 0.18; 'header:User-Agent:1': 0.23; 'convenient': 0.24; 'instance,': 0.24; 'header:X-Complaints-To:1': 0.27; 'chris': 0.29; 'sets': 0.30; 'code': 0.31; 'class': 0.32; 'stuff': 0.32; 'guess': 0.33; 'but': 0.35; 'building': 0.35; 'version': 0.36; 'functions.': 0.36; 'doing': 0.36; "didn't": 0.36; 'charset :us-ascii': 0.36; 'too': 0.37; 'to:addr:python-list': 0.38; 'anything': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'received:org': 0.40; 'even': 0.60; 'remove': 0.60; 'became': 0.64; 'hang': 0.67; 'dict.': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Neil Cerutti Subject: Re: Python glob and raw string Date: Thu, 16 Jan 2014 18:45:49 +0000 (UTC) Organization: Norwich University References: <6d3dd7d7-6836-4b55-9d1c-9e70e18b66fd@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: jackman.norwich.edu User-Agent: slrn/0.9.9p1/mm/ao (Win32) 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1389897976 news.xs4all.nl 2934 [2001:888:2000:d::a6]:44195 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:64098 On 2014-01-16, Chris Angelico wrote: >> Hmmm... I might be doing too much in __init__. ;) > > Hmm, why is it even a class? :) I guess you elided all the > stuff that makes it impractical to just use a non-class > function. I didn't remove anything that makes it obviously class-worthy, just timestamp checking, and several dicts and sets to store data. The original version of that code is just a set of three functions, but the return result of that version was a single dict. Once the return value got complicated enough to require building up a class instance, it became a convenient place to hang the functions. -- Neil Cerutti