Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'else:': 0.03; 'subject:Python': 0.05; '*is*': 0.09; 'instantiated': 0.09; 'received:mail-lpp01m010-f46.google.com': 0.09; 'def': 0.10; 'aug': 0.13; ':-)': 0.13; "'q'": 0.16; 'infinitely': 0.16; 'innermost': 0.16; 'nest': 0.16; 'subject:Objects': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'variables': 0.17; 'jan': 0.18; '>>>': 0.18; 'variable': 0.20; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; "d'aprano": 0.29; 'steven': 0.29; 'related': 0.30; 'received:209.85.215.46': 0.30; 'to:addr :python-list': 0.33; 'received:google.com': 0.34; 'wrong': 0.34; 'pm,': 0.35; 'sometimes': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'there': 0.35; 'but': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'nothing': 0.38; 'to:addr:python.org': 0.39; 'called': 0.39; 'header:Received:5': 0.40; 'times': 0.63; 'six': 0.65; '100': 0.78; 'to:name:python': 0.84; 'hundred': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=70l29xkl8zrqQXVjuyIZSK4ZTCCPVJp9uebW2amOXl8=; b=1CP90iemzmHTXUASXaV9itZ5TKGB40ef9iBKOz7hTRnEtLqM5dbiXHQnTMr9k1ZUrG +OFFsRoUg5c2B6CKtgoyGuM+OA35n9MVLE4b+eczjVhCEhDVi+SSKHb+/pfbaTXjUIiD U8Fc+mwFURc8yVO8YvLwhEwEGrz50JobCrmWWswqVL1c5hOFmy3Z75HlCU132lJfEtMO odO5/6mJOUoXOyrkdvVmbMZLqFj9pxDGJf4lDti4txLtJeNlG9b/sRIr3MlFAPAXsOk8 Lf9jhXRPmbE0vHQqbdOChkwRgIobcT7jnPOO+sorDsmbp0ZJ7PA2zhYPdz27hL4eUvEV b10Q== MIME-Version: 1.0 In-Reply-To: References: <18409992-1e28-4721-8e64-60c69668da4e@googlegroups.com> <1pidnX71rLNrsajNnZ2dnUVZ8jCdnZ2d@bt.com> <5035ad87$0$1645$c3e8da3$76491128@news.astraweb.com> From: Ian Kelly Date: Thu, 23 Aug 2012 12:17:37 -0600 Subject: Re: Objects in Python To: Python Content-Type: text/plain; charset=ISO-8859-1 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: 1345745889 news.xs4all.nl 6937 [2001:888:2000:d::a6]:48464 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27755 On Thu, Aug 23, 2012 at 12:02 PM, Jan Kuiken wrote: > On 8/23/12 06:11 , Steven D'Aprano wrote: > >>> 2) Related to the above, you can infinitely nest scopes. There's nothing >>> wrong with having six variables called 'q'; you always use the innermost >>> one. Yes, this can hurt readability >> >> >> Well, there you go. There *is* something wrong with having six variables >> called 'q'. > > > Sometimes you don't want only six variables called 'q' but a hundred > of them :-) > > def fac(q): > if q < 1 : > return 1 > else: > return q * fac(q-1) > > print(fac(100)) That's only one variable called 'q', instantiated 100 times simultaneously.