On Jan 6, 8:56 am, [EMAIL PROTECTED] wrote:
> some more doubts in this area,,forgive the ignorance of a beginner
>
> i have
>
> class MyError(Exception):
>def __init__(self,msg)
> self.msg=msg
>
> now my method that can raise this is
>
> class SomeClass:
> ...
>def mymetho
[EMAIL PROTECTED] wrote:
> ...if another method in the same class calls this method but wants to
> pass the error to a gui code which calls it,,can i do like this
>
> def callingmethode(self):
> try:
> mymethod()
> except MyError,myerr:
> raise myerr
>
> so that I
forget about syntax err.. sorry ..but still would like to know if
raising exception inside an except clause the right way?
--
http://mail.python.org/mailman/listinfo/python-list
some more doubts in this area,,forgive the ignorance of a beginner
i have
class MyError(Exception):
def __init__(self,msg)
self.msg=msg
now my method that can raise this is
class SomeClass:
...
def mymethod(self):
if (somecondition):
raise MyError("somec
On Jan 3, 3:49 pm, [EMAIL PROTECTED] wrote:
> hi, i have some code where i set a bool type variable and if the value
> is false i would like to return from the method with an error msg..
> being a beginner I wd like some help here
>
> class myclass:
> .
> def mymethod(self):
>
hi bukzor & everyone who replied
thanks for the detailed replies
will try to write that way
thanx a lot
jim
bukzor wrote:
> On Jan 4, 8:51 am, bukzor <[EMAIL PROTECTED]> wrote:
>
> #exercise of the class and error handling
> m = myclass()
> try:
> m.mymethod()
> print "Completed success
On Jan 4, 8:51 am, bukzor <[EMAIL PROTECTED]> wrote:
> On Jan 3, 7:49 am, [EMAIL PROTECTED] wrote:
>
>
>
> > hi, i have some code where i set a bool type variable and if the value
> > is false i would like to return from the method with an error msg..
> > being a beginner I wd like some help here
>
On Jan 3, 7:49 am, [EMAIL PROTECTED] wrote:
> hi, i have some code where i set a bool type variable and if the value
> is false i would like to return from the method with an error msg..
> being a beginner I wd like some help here
>
> class myclass:
> .
> def mymethod(self):
>
On Jan 3, 10:09 am, [EMAIL PROTECTED] wrote:
>
> With my philosophical programming hat on the first thing I'd say (as a
> fairly beginning python programmer) is "avoid multiple returns from a
> function/method if at all possible". They breed all sorts of problems
> and errors, in particular if the
Chris Mellon <[EMAIL PROTECTED]> wrote:
> On 03 Jan 2008 16:09:53 GMT, <[EMAIL PROTECTED]> wrote:
> >
> > [EMAIL PROTECTED] wrote:
> > > hi, i have some code where i set a bool type variable and if the value
> > > is false i would like to return from the method with an error msg..
> > > being a be
On 03 Jan 2008 16:09:53 GMT, <[EMAIL PROTECTED]> wrote:
>
> [EMAIL PROTECTED] wrote:
> > hi, i have some code where i set a bool type variable and if the value
> > is false i would like to return from the method with an error msg..
> > being a beginner I wd like some help here
> >
> > class myclas
[EMAIL PROTECTED] wrote:
> hi, i have some code where i set a bool type variable and if the value
> is false i would like to return from the method with an error msg..
> being a beginner I wd like some help here
>
> class myclass:
> .
> def mymethod(self):
> success=
[EMAIL PROTECTED] wrote:
> hi, i have some code where i set a bool type variable and if the value
> is false i would like to return from the method with an error msg..
> being a beginner I wd like some help here
>
> class myclass:
> .
> def mymethod(self):
> success
hi, i have some code where i set a bool type variable and if the value
is false i would like to return from the method with an error msg..
being a beginner I wd like some help here
class myclass:
.
def mymethod(self):
success=True
msg="all validation OK"
14 matches
Mail list logo