On Tue, Mar 1, 2016 at 2:41 AM, Martin A. Brown wrote:
> Please read below. I will take a stab at explaining the gaps of
> understanding you seem to have (others have tried already, but I'll
> try, as well).
>
> I am going to give you four different functions which
On Tue, 1 Mar 2016 03:29 am, Ian Kelly wrote:
> On Mon, Feb 29, 2016 at 8:18 AM, Ganesh Pal wrote:
>> Iam on python 2.6
>
> Python 2.6 has been unsupported since October 2013. Among other
> things, that means it is no longer receiving security updates like
> more recent
On Mon, Feb 29, 2016 at 4:14 PM, Cameron Simpson wrote:
> Another remark here: if you're going to log, log the exception as well:
>
> logging.error("something went wrong: %s", e)
>
> Ian's example code is nice and simple to illustrate "log and then reraise"
> but few things
Cameron Simpson wrote:
> On 29Feb2016 10:45, Ian Kelly wrote:
>>On Mon, Feb 29, 2016 at 10:26 AM, Ganesh Pal wrote:
>>> On Mon, Feb 29, 2016 at 9:59 PM, Ian Kelly wrote:
On Mon, Feb 29, 2016 at 8:18 AM, Ganesh Pal
On 29Feb2016 10:45, Ian Kelly wrote:
On Mon, Feb 29, 2016 at 10:26 AM, Ganesh Pal wrote:
On Mon, Feb 29, 2016 at 9:59 PM, Ian Kelly wrote:
On Mon, Feb 29, 2016 at 8:18 AM, Ganesh Pal wrote:
1. usage
Greetings Ganesh,
>> You're falling into the trap of assuming that the only exception you
>> can ever get is the one that you're planning for, and then handling.
>
>Ok sure !
This point is very important, so I'll reiterate it. I hope the poor
horse lives.
>> ALL exceptions as though they
sohcahto...@gmail.com:
> Every time you say "try-expect", my head wants to explode.
>
> It is called a "try-except" block, because you're using the key words
> "try" and "except" when you make one.
Ah, I remember a Python-based test system idea where the "except"
keyword meant "expect":
On Mon, Feb 29, 2016 at 2:49 PM, Ganesh Pal wrote:
> On Mar 1, 2016 12:06 AM, "Chris Angelico" wrote
> >
> > You're falling into the trap of assuming that the only exception you
> > can ever get is the one that you're planning for, and then handling.
>
>
On Mar 1, 2016 12:06 AM, "Chris Angelico" wrote
>
> You're falling into the trap of assuming that the only exception you
> can ever get is the one that you're planning for, and then handling.
Ok sure !
> ALL exceptions as though they were that one. Instead catch ONLY the
>
On Monday, February 29, 2016 at 10:21:57 AM UTC-8, Ganesh Pal wrote:
> >> How do we reraise the exception in python , I have used raise not
> >> sure how to reraise the exception
> >
> > raise with no arguments will reraise the exception currently being handled.
> >
> > except Exception:
> >
On Tue, Mar 1, 2016 at 5:21 AM, Ganesh Pal wrote:
>
> In my case the exception is nothing but the error example if we plan
> to run the command say #ifconfig -a and the command fails because of
> a type ( say u ran #igconfig -a).
>
> we will the output as
>
> # Failed to
>> How do we reraise the exception in python , I have used raise not
>> sure how to reraise the exception
>
> raise with no arguments will reraise the exception currently being handled.
>
> except Exception:
> logging.error("something went wrong")
> raise
Thanks Ian for taking time and
On Mon, Feb 29, 2016 at 10:26 AM, Ganesh Pal wrote:
> On Mon, Feb 29, 2016 at 9:59 PM, Ian Kelly wrote:
>> On Mon, Feb 29, 2016 at 8:18 AM, Ganesh Pal wrote:
>>> Iam on python 2.6
>
>>> 1. usage of try- expect
>>
>> try-except
On Mon, Feb 29, 2016 at 9:59 PM, Ian Kelly wrote:
> On Mon, Feb 29, 2016 at 8:18 AM, Ganesh Pal wrote:
>> Iam on python 2.6
>> 1. usage of try- expect
>
> try-except in every single function is a code smell. You should only
> be using it where you're
On Mon, Feb 29, 2016 at 8:18 AM, Ganesh Pal wrote:
> Iam on python 2.6
Python 2.6 has been unsupported since October 2013. Among other
things, that means it is no longer receiving security updates like
more recent versions. Unless you have an extremely strong reason for
15 matches
Mail list logo