well, if it helps improve speed, than that's fine. although
i don't see how really.
first of all, exceptions raised by python code must be
normalized as the code might need the exception object, i.e.
try:
foo
except bar:
ex = sys.exc_info()
so the only place it's meaningful is exceptions
Phillip J. Eby wrote:
> The 2-expression "raise" statement translation is incorrect in the general
> case; it is possible for the second argument to be an instance of the first
> argument, in which case 'raise E, V' should become just 'raise V'. This is
> not detectable by the refactoring tool,
On 1/22/07, Mark Hammond <[EMAIL PROTECTED]> wrote:
> Guido has mentioned [1] that since exceptions will be growing a
> __traceback__ attribute in Python 3, it should be possible to remove
> sys.exc_info().
sys.exc_info() is also useful for returning the exception itself, not only
the traceback
On 1/23/07, Nick Coghlan <[EMAIL PROTECTED]> wrote:
> Phillip J. Eby wrote:
> > The 2-expression "raise" statement translation is incorrect in the general
> > case; it is possible for the second argument to be an instance of the first
> > argument, in which case 'raise E, V' should become just 'rai
On 1/23/07, Thomas Wouters <[EMAIL PROTECTED]> wrote:
>
>
> On 1/22/07, Mark Hammond <[EMAIL PROTECTED]> wrote:
> > > Guido has mentioned [1] that since exceptions will be growing a
> > > __traceback__ attribute in Python 3, it should be possible to remove
> > > sys.exc_info().
> >
> > sys.exc_info
On 1/23/07, Thomas Wouters <[EMAIL PROTECTED]> wrote:
>
> On 1/22/07, Mark Hammond <[EMAIL PROTECTED]> wrote:
> > > Guido has mentioned [1] that since exceptions will be growing a
> > > __traceback__ attribute in Python 3, it should be possible to remove
> > > sys.exc_info().
> >
> > sys.exc_info()
On Tuesday 23 January 2007 11:52, Steven Bethard wrote:
> Sorry, for those of us following along at home ;-) could someone
> explain why we couldn't just introduce a ``sys.get_exception()`` or
> something like that which would then make the exception (and therefore
> the traceback) available?
On 1/23/07, Steven Bethard <[EMAIL PROTECTED]> wrote:
On 1/23/07, Thomas Wouters <[EMAIL PROTECTED]> wrote:
>
> On 1/22/07, Mark Hammond <[EMAIL PROTECTED]> wrote:
> > > Guido has mentioned [1] that since exceptions will be growing a
> > > __traceback__ attribute in Python 3, it should be possib
On 1/23/07, Thomas Wouters <[EMAIL PROTECTED]> wrote:
> On 1/23/07, Steven Bethard <[EMAIL PROTECTED]> wrote:
> > Sorry, for those of us following along at home ;-) could someone
> > explain why we couldn't just introduce a ``sys.get_exception()`` or
> > something like that which would then make th
On 1/23/07, Steven Bethard <[EMAIL PROTECTED]> wrote:
> On 1/23/07, Thomas Wouters <[EMAIL PROTECTED]> wrote:
> > On 1/23/07, Steven Bethard <[EMAIL PROTECTED]> wrote:
> > > Sorry, for those of us following along at home ;-) could someone
> > > explain why we couldn't just introduce a ``sys.get_exc
On 1/23/07, Nick Coghlan <[EMAIL PROTECTED]> wrote:
> Phillip J. Eby wrote:
> > The 2-expression "raise" statement translation is incorrect in the general
> > case; it is possible for the second argument to be an instance of the first
> > argument, in which case 'raise E, V' should become just 'rai
On 1/23/07, Collin Winter <[EMAIL PROTECTED]> wrote:
> On 1/23/07, Nick Coghlan <[EMAIL PROTECTED]> wrote:
> > Phillip J. Eby wrote:
> > > The 2-expression "raise" statement translation is incorrect in the general
> > > case; it is possible for the second argument to be an instance of the
> > > fi
On 1/23/07, Brett Cannon <[EMAIL PROTECTED]> wrote:
> On 1/23/07, Collin Winter <[EMAIL PROTECTED]> wrote:
> >This form has two sub-variants: ``E`` may be either an
> >instance of ``BaseException`` [#pep352]_ or a subclass of
> >``BaseException``. If ``E`` is a subclass, it will be called w
On 1/23/07, Collin Winter <[EMAIL PROTECTED]> wrote:
> Does this language work for you?
> """
> 2. ``raise E`` (with a single argument) is used to raise a new
>exception. This form has two sub-variants: ``E`` may be either an
>instance of ``BaseException`` [#pep352]_ or a subclass of
>
On 1/22/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote:
The correct translation of a try/except should be:
try:
...
except E as N:
try:
...
finally:
N = None
del N
i.e., you left out the crucial try/finally wrapper. If y
On 1/23/07, Collin Winter <[EMAIL PROTECTED]> wrote:
> On 1/23/07, Brett Cannon <[EMAIL PROTECTED]> wrote:
> > On 1/23/07, Collin Winter <[EMAIL PROTECTED]> wrote:
> > >This form has two sub-variants: ``E`` may be either an
> > >instance of ``BaseException`` [#pep352]_ or a subclass of
> > >
On 22/01/2007 23.45, Collin Winter wrote:
> target, thus eliminating the reference cycle. The source-to-source
> translation, as suggested by Phillip J. Eby [#except-translation]_ is
> ::
>
> try:
> ...
> except E as N:
> ...
> ...
>
> is translated to ::
>
>
17 matches
Mail list logo