-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
[mypy] fix small folders #4292
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
[mypy] fix small folders #4292
Changes from 9 commits
730cf6d
06c8abc
9547066
d90f331
2bab03d
2bc9ea2
da0668d
23d2a74
e2b3a53
9708998
aaef06b
2f7c473
19eba4b
53fae44
1589b47
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -13,7 +13,7 @@ | |||||
print("Receiving data...") | ||||||
while True: | ||||||
data = sock.recv(1024) | ||||||
print(f"data={data}") | ||||||
print(f"data={str(data)}") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this change?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This and similar changes are redundant as string interpolation converts the object to string using the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure why but without it we get the following mypy-errors: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess it has something to do with the method from the socket-package that returns the data-object. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
if not data: | ||||||
break | ||||||
out_file.write(data) # Write data to a file | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -13,7 +13,7 @@ def send_file(filename: str = "mytext.txt", testing: bool = False) -> None: | |||||
conn, addr = sock.accept() # Establish connection with client. | ||||||
print(f"Got connection from {addr}") | ||||||
data = conn.recv(1024) | ||||||
print(f"Server received {data}") | ||||||
print(f"Server received {str(data)}") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
with open(filename, "rb") as in_file: | ||||||
data = in_file.read(1024) | ||||||
|
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.
@dhruvmanila Do we need these imports for basic types in Python 3.9 and the current mypy?
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.
No, I updated the issue with the message: #4052 (comment)
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.
I see, I made the corresponding changes. One difference is that the basic types are spelled lower case without this import.