【发布时间】:2015-03-02 14:41:27
【问题描述】:
如何在类中使用“默认”方法,例如:string.lower()?
这是我得到的错误:
result = text.lower.replace(string.punctuation, ' ').split(' ')
AttributeError: MyClass instance has no attribute 'lower'
【问题讨论】:
标签: python class python-2.7 python-3.x attributeerror