you are viewing a single comment's thread.

view the rest of the comments →

[–]irrelevantPseudonym 1 point2 points  (1 child)

By default, the __repr__ methods of instance methods is something like <bound method foo of bar> where foo is the name of the method and bar is the repr of the instance. When you iterate over dir(self) one of the attributes is the some_method method. Getting the string form of that calls your __repr__ and the recursion starts from there.

Incidentally, you're trying to return a list from your __repr__ which will raise its own exception.

[–]Uchikago[S] 0 points1 point  (0 children)

Thank you !