On Tue, 5 Dec 2017 02:52:44 +1100
Steven D'Aprano wrote:
> On Mon, Dec 04, 2017 at 01:52:19PM +0100, Antoine Pitrou wrote:
> > On Mon, 4 Dec 2017 23:16:11 +1100
> > Steven D'Aprano wrote:
> > > On Mon, Dec 04, 2017 at 12:06:38PM +0100, Antoine Pitrou
On Mon, Dec 26, 2016 at 8:51 AM, Victor Stinner
wrote:
> Le 24 déc. 2016 8:42 PM, "Neil Girdhar" a écrit :
>> Usually, when an exception is hit that will (probably) crash the program,
>> no one cares about less than a microsecond of performance.
>
Le 24 déc. 2016 8:42 PM, "Neil Girdhar" a écrit :
> Usually, when an exception is hit that will (probably) crash the program,
no one cares about less than a microsecond of performance.
Just one example. By design, hasattr(obj, name) raises an exception to
return False.
So
On 12/24/2016 11:42 AM, Neil Girdhar wrote:
Usually, when an exception is hit that will (probably) crash the
program, no one cares about less than a microsecond of performance.
I would probably agree with you in the SyntaxError example, but not for
the others. Programming with exceptions is
On Tuesday, November 29, 2016 at 4:08:19 AM UTC-5, Victor Stinner wrote:
>
> Hi,
>
> Python is optimized for performance. Formatting an error message has a
> cost on performances.
>
>
Usually, when an exception is hit that will (probably) crash the program,
no one cares about less than a
On 29/11/2016 20:09, Terry Reedy wrote:
On 11/29/2016 11:32 AM, Rob Cliffe wrote:
On 29/11/2016 04:58, victor rajewski wrote:
Traceback (most recent call last):
File "foo.py", line 2, in
l[10]=14
IndexError: list assignment index out of range
A better message might be:
You
Victor Stinner writes:
> Using a custom exception handler, you can run expensive functions,
> like the feature: "suggest len when length is used".
LGTM.
> The problem is then when students have to use a Python without the
> custom exception handler.
Put the exception handler in an
On 2016-11-29 19:45, Brendan Barnwell wrote:
On 2016-11-29 09:43, Brett Cannon wrote:
One way to make this cheap is to have a reasonable default message and
use attributes on the exceptions trigger the use of the default message.
Nearly a year ago I filed a bunch of issues for ideas on
On Nov 29, 2016 9:43 AM, "Brett Cannon" wrote:
>
>
>
> On Tue, 29 Nov 2016 at 02:39 Nathaniel Smith wrote:
>>
>> On Tue, Nov 29, 2016 at 1:05 AM, Victor Stinner
>> wrote:
>> > Hi,
>> >
>> > Python is optimized for performance.
On 11/29/2016 11:32 AM, Rob Cliffe wrote:
On 29/11/2016 04:58, victor rajewski wrote:
Traceback (most recent call last):
File "foo.py", line 2, in
l[10]=14
IndexError: list assignment index out of range
A better message might be:
You tried to use l[10] when l is only 4 elements
On 2016-11-29 09:43, Brett Cannon wrote:
One way to make this cheap is to have a reasonable default message and
use attributes on the exceptions trigger the use of the default message.
Nearly a year ago I filed a bunch of issues for ideas on providing
attributes on exceptions where it made
On Tue, 29 Nov 2016 at 10:28 Nick Timkovich wrote:
> I would consider the speed of the "ultimate error handler" (i.e. whatever
> prints the traceback and kills the program) in the interpreter to be moot,
> so long as it takes a small fraction of a second. Optimizing
I would consider the speed of the "ultimate error handler" (i.e. whatever
prints the traceback and kills the program) in the interpreter to be moot,
so long as it takes a small fraction of a second. Optimizing Python's speed
it crashes super-fast due to an *unhandled* NameError in your program
On Tue, Nov 29, 2016 at 5:48 AM, Nick Coghlan wrote:
> > SyntaxErrors in an inner loop? That seems unlikely to me.
>
Syntax Errors are a special case, as by definition the code isn't being run
yet (yes, there could be an eval in there...)
So we could at least make those
On Tue, 29 Nov 2016 at 02:39 Nathaniel Smith wrote:
> On Tue, Nov 29, 2016 at 1:05 AM, Victor Stinner
> wrote:
> > Hi,
> >
> > Python is optimized for performance. Formatting an error message has a
> > cost on performances.
>
> Sure, but we have to look
On 29/11/2016 04:58, victor rajewski wrote:
Traceback (most recent call last):
File "foo.py", line 2, in
l[10]=14
IndexError: list assignment index out of range
A better message might be:
You tried to use l[10] when l is only 4 elements long. You can add
items to l using
On 29 November 2016 at 20:38, Nathaniel Smith wrote:
> On Tue, Nov 29, 2016 at 1:05 AM, Victor Stinner
> wrote:
>> Hi,
>>
>> Python is optimized for performance. Formatting an error message has a
>> cost on performances.
>
> Sure, but we have to look at
On Tuesday, November 29, 2016, Wes Turner wrote:
> The existing docs for errors and exceptions:
>
> - https://docs.python.org/2/library/exceptions.html
> - https://docs.python.org/3/library/exceptions.html
> -
On Tuesday, November 29, 2016, Nathaniel Smith wrote:
> On Tue, Nov 29, 2016 at 1:05 AM, Victor Stinner
> > wrote:
> > Hi,
> >
> > Python is optimized for performance. Formatting an error message has a
> > cost on performances.
>
> Sure,
The existing docs for errors and exceptions:
- https://docs.python.org/2/library/exceptions.html
- https://docs.python.org/3/library/exceptions.html
- https://hg.python.org/cpython/file/tip/Doc/library/exceptions.rst
- https://github.com/python/cpython/blob/master/Doc/library/exceptions.rst
-
Hi,
Python is optimized for performance. Formatting an error message has a
cost on performances.
I suggest you to teach your student to use the REPL and use a custom
exception handler: sys.excepthook:
https://docs.python.org/2/library/sys.html#sys.excepthook
Using a custom exception handler,
I'm +1 to the idea of improving error messages :)
(but maybe not to the exact new error messages proposed)
Raymond Hettinger touched on this topic during his Pycon Canada keynote, as
one of the positive contributions that you can do to cpython.
>
> Traceback (most recent call last):
>
> File
Sorry, I forgot the subject line!
On Tue., 29 Nov. 2016, 3:58 pm victor rajewski, wrote:
> I teach a computing subject to high school students using Python as our
> primary language. One thing that often causes confusion at the start is
> error messages/exceptions. I think
On 2016-11-29 02:58, victor rajewski wrote:
NameError: name 'reponse' is not defined
A better message might be:
You're trying to use the value of 'reponse', but that variable hasn't
got a value yet. You can give it a value earlier in the code, or it
could be a typo. You have a variable called
24 matches
Mail list logo