#156 'maximum recursion depth exceeded' when __len__ is defined

closed-invalid
Oleg Broytman
None
5
2006-11-13
2006-02-05
Karl Bartel
No

class BugListEntry(SQLObject):
bug_list = ForeignKey('BugList')

class BugList(SQLObject):
entries = MultipleJoin('BugListEntry')

def __len__(self):
return len(self.entries)

When I'm calling 'BugList()' I get a 'RuntimeError: maximum recursion
depth exceeded'. Is this a bug in SQLObject, or am I doing something
wrong?
It works fine when I'm removing the '__len__' method.

I'm using SQLObject as a part of TurboGears 8.8 with an SQLite database.

Discussion

  • Oleg Broytman
    Oleg Broytman
    2006-02-06

    Logged In: YES
    user_id=4799

    I cannot reproduce it. The program doesn't raise an
    exception. Can you write a complete test program (without
    TG) and show the exception it raises?

    BTW, look at the FAQ in the repository:
    http://svn.colorstudy.com/SQLObject/docs/FAQ.txt to
    understand the reasons why there is no __len__.

     
  • Oleg Broytman
    Oleg Broytman
    2006-11-13

    • labels: 519515 -->
    • assigned_to: nobody --> phd
    • status: open --> closed-invalid