I Need A Placeholder

Deverter,Mark mark.deverter at dads.state.tx.us
Thu Jun 26 19:09:38 CEST 2008


I typically use pass for a place holder.

try:
      # Do some code here
      var = 1         # For example
except:
      pass

HTH,
Mark

-----Original Message-----
From: python-list-bounces+mark.deverter=dads.state.tx.us at python.org
[mailto:python-list-bounces+mark.deverter=dads.state.tx.us at python.org] On
Behalf Of Ampedesign
Sent: Thursday, June 26, 2008 12:04 PM
To: python-list at 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 block, I
get an error back saying that the except block is not properly
formatted, since it has no content other than a comment.

So if anyone could suggest some code to put there as a placeholder
that would be wonderful.
--
http://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list