蟒蛇人
strings的Python项目详细描述
人类的Python弦。
用法:
>>>fromstringsimportstring>>>s=string("Hello, World")>>>s'Hello, World'>>>s.len()12>>>s.length12>>>s.size12>>>s+", What?"Traceback(mostrecentcalllast):File"strings.py",line27,in<module>x=s.add(", world")File"strings.py",line20,inaddreturnself+string(value)File"strings.py",line23,in__add__raiseNotImplementedError("Use add instead")NotImplementedError:Useaddinstead>>>s.add(", What?")'Hello, World, What?'
背景
受到愚人节笑话的启发。