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


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

Re: __missing__ for the top-level Python script

Started byChris Angelico <rosuav@gmail.com>
First post2014-11-13 04:49 +1100
Last post2014-11-13 04:49 +1100
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: __missing__ for the top-level Python script Chris Angelico <rosuav@gmail.com> - 2014-11-13 04:49 +1100

#80614 — Re: __missing__ for the top-level Python script

FromChris Angelico <rosuav@gmail.com>
Date2014-11-13 04:49 +1100
SubjectRe: __missing__ for the top-level Python script
Message-ID<mailman.15730.1415814578.18130.python-list@python.org>
On Thu, Nov 13, 2014 at 1:56 AM, Skip Montanaro
<skip.montanaro@gmail.com> wrote:
> sys.excepthook = autoload_exc
>
> I can't see a lot of people wanting this (I normally have its import
> commented out in my PYTHONSTARTUP file), and I think it would probably
> be bad practice for new users of the language.

Interesting data point there - that you actually have it handy and
choose not to use it. It's clearly designed for interactive mode, as
it assumes that it can restart entire blocks of code:

>>> for x in (1,2,3):
...  print x
...  if x==2: print os.pathsep
...
1
2
autoloading os
1
2
:
3

But that's about as good a "now go try this again" as will ever be
achieved with sys.excepthook, I expect.

ChrisA

[toc] | [standalone]


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


csiph-web