该法典应包含以下文字:
def __len__(self):
from sqlalchemy import func
self.len = session.query(func.count(Question.id)).scalar()
return int(self.len)
def __repr__(self):
self.repr = "traffic theory question, current number of questions:{0}".format(self.__len__)
return self.repr
我得到的东西(三个上层一线不断重复,然后按以下线终止):
File "C:Python27dirfile.py", line 129, in __repr__
self.repr = "traffic theory question, current number of questions:{0}".format(self.__len__)
RuntimeError: maximum recursion depth exceeded while getting the str of an object
我应强调,只有打电话<>repr时,我才会发现这一错误。 班级方法,但当我叫Llen(q)时(q)是同我一起工作的一米级单位)我得到正确答案!
任何 c?