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

zmq/eventloop/zmqstream.py, python3 doesn't have callable #79

Closed
indeyets opened this issue Mar 2, 2011 · 4 comments
Closed

zmq/eventloop/zmqstream.py, python3 doesn't have callable #79

indeyets opened this issue Mar 2, 2011 · 4 comments

Comments

@indeyets
Copy link

indeyets commented Mar 2, 2011

zmqstream.py has:

assert callback is None or callable(callback)

in python3 it should be

assert callback is None or hasattr(callback, '__call__')
@minrk
Copy link
Member

minrk commented Mar 2, 2011

I'll merge this one before we cut the release, thanks.

The 2to3 hasattr check is not equivalent to callable, but it should be just fine for our purposes.

@takluyver
Copy link
Contributor

Just to add: callable is actually back in Python 3.2. I appreciate that we want to support 3.1 and probably 3.0, but that might inform how we do it.

@minrk
Copy link
Member

minrk commented Mar 2, 2011

Thanks, that helps. I'll do a name check at the top, and add callable as a lambda at the top if it's undefined.

@minrk
Copy link
Member

minrk commented Mar 3, 2011

add callable where undefined (3.x < 3.2)

include test

closed by 2632a5c

KeyserSosa pushed a commit to KeyserSosa/pyzmq that referenced this issue Mar 21, 2014
This issue was closed.
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

No branches or pull requests

3 participants