Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #106434

Collection: weak error prompt drives beginner crazy

From animalize <animalize81@hotmail.com>
Newsgroups comp.lang.python
Subject Collection: weak error prompt drives beginner crazy
Date 2016-04-04 19:24 +0800
Message-ID <mailman.12.1459769484.32530.python-list@python.org> (permalink)
References <BLU436-SMTP189131DC7B039D2FC5B84F8B69D0@phx.gbl>

Show all headers | View raw


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 <module>
         import uuid
       File "D:\uuid.py", line 3, in <module>
         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.

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Collection: weak error prompt drives beginner crazy animalize <animalize81@hotmail.com> - 2016-04-04 19:24 +0800
  Re: Collection: weak error prompt drives beginner crazy Ned Batchelder <ned@nedbatchelder.com> - 2016-04-04 07:48 -0700

csiph-web