擅长:python、mysql、java
<p>正确的处理方法可能是引发异常。像这样的</p>
<pre><code>class BannedException(Exception):
"""The client is banned from the API."""
class API:
Array = {"status" : False, "result" : "Unidentified API Error"}
def __init__(self, URL):
self.isBanned()
print "This should be ignored."
def isBanned(self):
if True:
raise BannedException
API = API("http://google.com/");
</code></pre>