對Python比較新,我在PyFacebook庫中看到了下面的構造(源代碼在這裏:http://github.com/sciyoshi/pyfacebook/blob/master/facebook/init.py#L660)。我很好奇它做了什麼,因爲它似乎是一個繼承自己的類。繼承自己的Python類?這個怎麼用?
class AuthProxy(AuthProxy):
"""Special proxy for facebook.auth."""
def getSession(self):
"""Facebook API call. See http://developers.facebook.com/documentation.php?v=1.0&method=auth.getSession"""
...
return result
def createToken(self):
"""Facebook API call. See http://developers.facebook.com/documentation.php?v=1.0&method=auth.createToken"""
...
return token
這是幹什麼的?
切線相關,我在Eclipse中使用PyDev,並將其標記爲錯誤。我猜測事實並非如此。無論如何讓Eclipse知道這是好事?
猴子修補,蟒蛇方式。 – recursive