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

Added a class that implements read only of a file. #94

Merged
merged 12 commits into from
Feb 27, 2024
Merged

Conversation

rohe
Copy link
Contributor

@rohe rohe commented Feb 10, 2024

The file is expected to contain a set of information pieces. One per line. The class acts like a list, except that it's non-mutable..

The file is expected to contain a set of information pieces. One per line.
The class acts like a list, except that it's non-mutable..
Copy link
Member

@peppelinux peppelinux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few hints, approved

Comment on lines 21 to 23
for item in ["one", "two", "three"]:
fp.write(item)
fp.write("\n")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for item in ["one", "two", "three"]:
fp.write(item)
fp.write("\n")
fb.writelines(["one", "two", "three"])

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The '\n' at the end of the line is significant and writelines doesn't add those so I adopted a variant of what you proposed.

Comment on lines 84 to 87
if info == "":
return None
else:
return info
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if info == "":
return None
else:
return info
return info or None

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@rohe rohe merged commit 506b1d0 into main Feb 27, 2024
5 checks passed
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