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


Groups > comp.lang.python > #106435 > unrolled thread

Re: Collection: weak error prompt drives beginner crazy

Started byJoel Goldstick <joel.goldstick@gmail.com>
First post2016-04-04 07:38 -0400
Last post2016-04-04 07:38 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Collection: weak error prompt drives beginner crazy Joel Goldstick <joel.goldstick@gmail.com> - 2016-04-04 07:38 -0400

#106435 — Re: Collection: weak error prompt drives beginner crazy

FromJoel Goldstick <joel.goldstick@gmail.com>
Date2016-04-04 07:38 -0400
SubjectRe: Collection: weak error prompt drives beginner crazy
Message-ID<mailman.13.1459769916.32530.python-list@python.org>
On Mon, Apr 4, 2016 at 7:24 AM, animalize <animalize81@hotmail.com> 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 <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.

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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web