Re: I Need A Placeholder

2008-06-26 Thread John Salerno
"Peter Otten" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > if 0: 42 How Pythonic. ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: I Need A Placeholder

2008-06-26 Thread Peter Otten
John Salerno wrote: > "Joshua Kugler" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> except: >>pass >> >> is the usual technique there. > > Is there any other? if 0: 42 Proof: >>> def cp(pass_): ... return compile("try: 1/0\nexcept:\n %s" % pass_, "", "exec") ... >>>

Re: I Need A Placeholder

2008-06-26 Thread Carsten Haese
John Salerno wrote: "Joshua Kugler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] except: pass is the usual technique there. Is there any other? Sure. Evaluating any side-effect free expression and ignoring the result will work: try: # do somthing except: None

Re: I Need A Placeholder

2008-06-26 Thread John Salerno
"Joshua Kugler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > except: >pass > > is the usual technique there. Is there any other? -- http://mail.python.org/mailman/listinfo/python-list

RE: I Need A Placeholder

2008-06-26 Thread Deverter,Mark
@python.org Subject: I Need A Placeholder I'm trying to build a try/except case, and I want to have the except function like such: try: # Do some code here var = 1 # For example except: #Do nothing here The only problem is if I leave a comment only in the except blo

Re: I Need A Placeholder

2008-06-26 Thread Ampedesign
On Jun 26, 10:08 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > Ampedesign <[EMAIL PROTECTED]> wrote: > > I'm trying to build a try/except case, and I want to have the except > > function like such: > > > try: > >       # Do some code here > >       var = 1         # For example > > except: > >    

Re: I Need A Placeholder

2008-06-26 Thread Joshua Kugler
Ampedesign wrote: > I'm trying to build a try/except case, and I want to have the except > function like such: > > try: > # Do some code here > var = 1 # For example > except: > #Do nothing here > > The only problem is if I leave a comment only in the except block, I >

Re: I Need A Placeholder

2008-06-26 Thread Duncan Booth
Ampedesign <[EMAIL PROTECTED]> wrote: > I'm trying to build a try/except case, and I want to have the except > function like such: > > try: > # Do some code here > var = 1 # For example > except: > #Do nothing here > > The only problem is if I leave a comment only in th

Re: I Need A Placeholder

2008-06-26 Thread Ampedesign
On Jun 26, 10:06 am, Daniel Mahoney <[EMAIL PROTECTED]> wrote: > On Thu, 26 Jun 2008 10:03:47 -0700, Ampedesign wrote: > > I'm trying to build a try/except case, and I want to have the except > > function like such: > > > try: > >       # Do some code here > >       var = 1         # For example >

Re: I Need A Placeholder

2008-06-26 Thread Daniel Mahoney
On Thu, 26 Jun 2008 10:03:47 -0700, Ampedesign wrote: > I'm trying to build a try/except case, and I want to have the except > function like such: > > try: > # Do some code here > var = 1 # For example > except: > #Do nothing here > > The only problem is if I leave a co

Re: I Need A Placeholder

2008-06-26 Thread Gary Herron
Ampedesign wrote: I'm trying to build a try/except case, and I want to have the except function like such: try: # Do some code here var = 1 # For example except: #Do nothing here try: # Do some code here var = 1 # For example except: pass

I Need A Placeholder

2008-06-26 Thread Ampedesign
I'm trying to build a try/except case, and I want to have the except function like such: try: # Do some code here var = 1 # For example except: #Do nothing here The only problem is if I leave a comment only in the except block, I get an error back saying that the except