-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update subscription patterns to automatically convert strs to bytes #3
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Worth considering though. View full project report here.
@@ -37,7 +37,7 @@ | |||
|
|||
def publish(): | |||
data = str(time.time()) | |||
print "publishing %r" % data | |||
print("publishing %r" % data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f-string is easier to read, write, and less computationally expensive than legacy string formatting. More.
@@ -48,7 +48,7 @@ def publish(): | |||
s.subscribe("") | |||
|
|||
def doPrint(*args): | |||
print "message received: %r" % (args, ) | |||
print("message received: %r" % (args, )) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, Consider using f-string instead.
@@ -41,11 +41,11 @@ | |||
|
|||
def produce(): | |||
data = [str(time.time()), socket.gethostname()] | |||
print "producing %r" % data | |||
print("producing %r" % data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f-string is easier to read, write, and less computationally expensive than legacy string formatting. More details.
@@ -54,7 +54,7 @@ def produce(): | |||
s = ZmqPullConnection(zf, e) | |||
|
|||
def doPrint(message): | |||
print "consuming %r" % (message,) | |||
print("consuming %r" % (message,)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, Consider using f-string instead.
@@ -40,7 +40,7 @@ def produce(): | |||
# data = [str(time.time()), socket.gethostname()] | |||
data = str(time.time()) | |||
|
|||
print "Requesting %r" % data | |||
print("Requesting %r" % data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f-string is easier to read, write, and less computationally expensive than legacy string formatting. Read more.
@@ -63,7 +63,7 @@ def onTimeout(fail): | |||
s = ZmqREPConnection(zf, e) | |||
|
|||
def doPrint(messageId, message): | |||
print "Replying to %s, %r" % (messageId, message) | |||
print("Replying to %s, %r" % (messageId, message)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, Consider using f-string instead.
No description provided.