"Peter Otten" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> if 0: 42
How Pythonic. ;-)
--
http://mail.python.org/mailman/listinfo/python-list
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")
...
>>>
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
"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
@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
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:
> >
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
>
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
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
>
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
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'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
12 matches
Mail list logo