Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix recursive reprs on baseserver #501

Merged

Conversation

llllllllll
Copy link
Contributor

When the handle function was an instancemethod of the baseserver, the funcname would contain the repr of the baseserver leading to a recursively defined repr.

@llllllllll llllllllll force-pushed the non-recursive-reprs-of-baseserver branch from 0ac0b74 to 03e7d51 Compare March 8, 2015 06:10
@llllllllll llllllllll force-pushed the non-recursive-reprs-of-baseserver branch from 03e7d51 to 8be65f8 Compare March 11, 2015 15:45
@jamadden
Copy link
Member

Can you talk about the use-case that would lead to that scenario? That is, why wouldn't the object simply override the handle method (I think that's the usual pattern) instead of setting a handle attribute to a different instance method?

@llllllllll
Copy link
Contributor Author

it doesn't; however, the repr of a MethodType object includes the repr of the parent, so when you repr the handle method, you repr the server which reprs the handle and there is where the recursion is.

@jamadden
Copy link
Member

In the usual case of overriding the handle method, though, there is no handle attribute in self.__dict__. There is a _handle attribute in the instance's dict (which is a bound method) , but the handle attribute is only in the class's dict, so I don't see how this can arise in the typical case.

I'm not saying this change is wrong, I'm just curious about the use case, in case there's something we can do to better support it.

@jamadden jamadden merged commit 8be65f8 into gevent:master Jun 26, 2015
@llllllllll
Copy link
Contributor Author

I remember opening this while working on qdb, let me go dig through the source and see why I needed this

@llllllllll
Copy link
Contributor Author

Okay, so the issue was that I didn't realize I could just override the handle method so I made a new method and passed it as the handle arg in init

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants