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

Update subscription patterns to automatically convert strs to bytes #3

Merged
merged 5 commits into from
Jun 15, 2023

Conversation

wbarnha
Copy link
Owner

@wbarnha wbarnha commented Jun 15, 2023

No description provided.

@wbarnha wbarnha self-assigned this Jun 15, 2023
Copy link

@code-review-doctor code-review-doctor bot left a 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)

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, ))

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)

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,))

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)

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))

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.

txzmq/test/test_pubsub.py Outdated Show resolved Hide resolved
@wbarnha wbarnha changed the title Update subscription patterns Update subscription patterns to automatically convert strs to bytes Jun 15, 2023
@wbarnha wbarnha merged commit c757f77 into master Jun 15, 2023
@wbarnha wbarnha deleted the connections branch June 15, 2023 23:52
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.

1 participant