Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Joel Goldstick Newsgroups: comp.lang.python Subject: Re: Collection: weak error prompt drives beginner crazy Date: Mon, 4 Apr 2016 07:38:27 -0400 Lines: 36 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de V9DZgw8UEodnRZrISzOU4QU8HgJGCJ1HM4mg4hXLIXdA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'that?': 0.05; 'cc:addr :python-list': 0.09; 'lines:': 0.09; 'received:209.85.218': 0.10; 'url:blog': 0.10; 'python': 0.10; 'subject:error': 0.11; 'output': 0.13; 'importing': 0.15; '2016': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:beginner': 0.16; 'wrote:': 0.16; 'attribute': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'am,': 0.23; 'import': 0.24; '(most': 0.24; 'header:In-Reply- To:1': 0.24; 'mon,': 0.24; 'module': 0.25; 'installed': 0.26; 'message-id:@mail.gmail.com': 0.27; 'itself,': 0.29; "i'm": 0.30; 'url:mailman': 0.30; 'e.g.': 0.30; 'says': 0.32; 'run': 0.33; 'url:python': 0.33; 'traceback': 0.33; 'url:listinfo': 0.34; 'file': 0.34; 'received:google.com': 0.35; 'library.': 0.35; 'problem.': 0.35; 'there': 0.36; 'url:org': 0.36; 'received:209.85': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'received:209': 0.38; 'rather': 0.39; 'url:mail': 0.40; 'hour': 0.69; 'url:info': 0.71; 'prompt': 0.79; 'to:none': 0.91; 'joel': 0.91 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:cc; bh=MgV/Vtf57Q6nD9yEnyL0q/KF3BTU5A/KuwBCG8XKK8o=; b=IFO4uuO9DyaXipBOcuS9ZWdof1E55NfamMaBu++B2oCydoC07Wzsknp7OENOIBzdN9 jX1fD+JjSNxXzloLWIlO5gJg0DBlfwuZdWCuG8BKON2e0dKaoEUjDPfmTgchUE2F13WW Oy2l3cf/SvyTC4q4UofFawh9KY+Of75H5mCqCj3B01peS5KoPNLyvrhph7NTxWjTMlFH r/yY5+s3kyfpDWCrTj33Oi5IVWKrFA8ROJLMumNKoSGYiUXNEVcdha8Hip6FH42MzDxW gdWwbG2B7gAa2iPMyVeS2w9ZfY/dJbo6wMKLcE1HoiUQ1LmyKIiLyIB3wyw+3kpszitQ 8sBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc; bh=MgV/Vtf57Q6nD9yEnyL0q/KF3BTU5A/KuwBCG8XKK8o=; b=Mz60C5AczRUKlJn+3mRFRncn2JViXl025c0lm5LcQyBYYnHF9v2wdm0PHYwo4zE1js vGGP2gxXOUQ8D6AqMiWi6jKB9QCGz3CTP2sgoZ0ZE3GimquV7rcgeTfqsyBafpEDJWpk g62k6N32+F9KHKOY9G/eFBX44P3mNtD1OwzNWuXSVbutFoVUMGH038wXHcp+5P/eRoLt 0QWZiR7m4ajHXWzGLLB7ESylRiVCE/NiaBgWDCxQJ/AT31q3+T+meedyaD4ZE7K63Vaf O8q2AJlsmQw1bbM2TxBwgwkKxbZ4zrvBXG2OYICfTDl4EDpIivfDGcV27MKn9r1PSvhC Cklw== X-Gm-Message-State: AD7BkJKtZib6oIsuJhybc20H5E1eNkTBBNkXD/cioTc/v7E2PdyGosuvk+27/XRMgmyeelZn1a1zSmBcaGtzbQ== X-Received: by 10.157.4.72 with SMTP id 66mr3651664otc.141.1459769908006; Mon, 04 Apr 2016 04:38:28 -0700 (PDT) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 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: X-Mailman-Original-References: Xref: csiph.com comp.lang.python:106435 On Mon, Apr 4, 2016 at 7:24 AM, animalize wrote: > An example, the file-name is conflict with library-name in stdlib or > installed library. > > There is a file uuid.py that only has two lines: > > import uuid > print(uuid.uuid4()) > > Run uuid.py, output on Python 3.5.1: > > Traceback (most recent call last): > File "D:\uuid.py", line 1, in > import uuid > File "D:\uuid.py", line 3, in > print(uuid.uuid4()) > AttributeError: module 'uuid' has no attribute 'uuid4' > > I was spending about an hour to find out what happend when I was a beginner, > and I found I'm not the only one who confused by this problem. > > If the prompt can be beginner-friendly a little bit, I think it's a very > good thing. > E.g. says you are importing the file itself, rather than importing other > file or library. And how can python know that? > -- > https://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays