Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:: [': 0.04; 'subject:Python': 0.06; 'assign': 0.07; 'assignment': 0.07; 'function,': 0.09; 'referenced': 0.09; 'wrong,': 0.09; '3:27': 0.16; 'assigned,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'func': 0.16; 'python-list,': 0.16; 'subject:Dev': 0.16; 'language': 0.16; 'wrote:': 0.18; 'variable': 0.18; "hasn't": 0.19; 'have:': 0.19; 'meant': 0.20; 'subject:] ': 0.20; '(in': 0.22; 'to:name:python-list@python.org': 0.22; 'error': 0.23; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'function': 0.29; 'leave': 0.29; 'message-id:@mail.gmail.com': 0.30; 'went': 0.31; '"",': 0.31; 'file': 0.32; 'stuff': 0.32; 'run': 0.32; 'text': 0.33; 'says': 0.33; '(most': 0.33; 'actively': 0.33; "i'd": 0.34; 'something': 0.35; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'should': 0.36; 'detail': 0.37; 'clear': 0.37; 'branch': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'track': 0.38; 'rather': 0.38; 'anything': 0.39; 'recent': 0.39; 'expect': 0.39; 'does': 0.39; 'though,': 0.39; 'to:addr:python.org': 0.39; 'according': 0.40; 'skip:u 10': 0.60; 'future': 0.60; 'simple': 0.61; 'name': 0.63; 'skip:n 10': 0.64; 'provide': 0.64; 'brief,': 0.84; 'ethan': 0.84; 'furman': 0.84; 'or:': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=fL7j2Q9JjOCt97AaF9fo2vRhuULfGfXmefDYZRfyR44=; b=lfsAepGl2pTZJFRDJyN4mLvkI+qBgOWqkr7nNI0vKwdiT3WB+QntFjcXP12LaSFzRK EAQ+nEHnnr+IvUrP/KvUBDG6iMJotlZuAsb0WAdKpvSB1kU8N2tOhGX7UNA6NNAlHvsj Zh5RYFw1ZjaVm218J0QUv44t6TtBEfYgZRx3dND/qVg2wy/fh6tVuRht0sLuvdWJu0H8 63J9L4AAJkz4SOzhsWD/fDYoGN2F29ZfCdQGkibdA3xVQ4hNWY3jjRuBEJOOu32hLiFy AujgYBPFrCwq73t+M2wMF0JWdw4O4oRl46CwDNBRoAd8zpG9fkw4nzIovz0EyblzJj67 gJLw== MIME-Version: 1.0 X-Received: by 10.58.29.16 with SMTP id f16mr17039596veh.23.1399788489689; Sat, 10 May 2014 23:08:09 -0700 (PDT) In-Reply-To: <536F0A48.5040604@stoneleaf.us> References: <235C4BFA-9770-481A-9FCF-21C3F036769C@gmail.com> <87ppjpwafk.fsf@elektro.pacujo.net> <536ad8f2$0$29965$c3e8da3$5496439d@news.astraweb.com> <87zjiqbmy5.fsf@elektro.pacujo.net> <536d7a7d$0$29980$c3e8da3$5496439d@news.astraweb.com> <9cc0ebf9-dbed-4d3d-91fc-2abb9b0103d0@googlegroups.com> <536dc3f7$0$29980$c3e8da3$5496439d@news.astraweb.com> <536decca$0$29980$c3e8da3$5496439d@news.astraweb.com> <536E799D.6080602@stoneleaf.us> <536E9C3A.7060706@stoneleaf.us> <536F0A48.5040604@stoneleaf.us> Date: Sun, 11 May 2014 16:08:09 +1000 Subject: Re: [Python-Dev] Values and objects From: Chris Angelico To: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1399788497 news.xs4all.nl 2945 [2001:888:2000:d::a6]:56230 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:71294 [ I think you meant for this to go to python-list, not python-dev. Sending this to python-list. ] On Sun, May 11, 2014 at 3:27 PM, Ethan Furman wrote: > Seriously though, error messages are chosen to provide a simple and clear > description that will help the user track down what went wrong, not for > enshrining in exact detail the language semantics. Would you really rather > have: > > Traceback (most recent call last): > File "", line 1, in > File "", line 2, in func > UnboundLocalError: the name 'not_here' does not yet exist as you have not > yet assigned anything to it so there is currently no variable by that name > although at some point (in the future of this function, or perhaps in a > branch that has been passed and did not execute) you will or did assign > something to it so it will exist in the future of this function or may exist > at this point in a future run of this function. > > or: > > Traceback (most recent call last): > File "", line 1, in > File "", line 2, in func > UnboundLocalError: local variable 'not_here' referenced before assignment The way I'd say it is: The error text should be brief, and can leave stuff out, but should not actively *conflict* with language semantics. So if it says there's a local variable that hasn't been assigned, I would expect it to mean that there is, according to language semantics, a local variable that can be in a state of not-being-assigned to. If that's not the case, the message definitely needs to be changed, because it's actively misleading. ChrisA