Skip to content

Add newline inclusive disclaimer #1770

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

Merged
merged 1 commit into from
Jan 10, 2025
Merged

Add newline inclusive disclaimer #1770

merged 1 commit into from
Jan 10, 2025

Conversation

diederikvdv
Copy link
Contributor

Hi, I got confused due to some ambiguity with the readline and readlines function.
I propose adding a disclaimer that the newline character is also included.

Some extra references about similar functions within Python

splitlines has the argument keeplinebreaks to make this choice for including or excluding newlines explicit. It defaults to removing the newline.
https://www.w3schools.com/python/ref_string_splitlines.asp

The documentation of readlines also doesn't state anything about including or excluding the newlines. It defaults to keeping the newline: similar to the fsspec implementation.
https://www.w3schools.com/python/ref_file_readlines.asp

@martindurant martindurant merged commit 30af5e1 into fsspec:master Jan 10, 2025
11 checks passed
@martindurant
Copy link
Member

Thanks!

@diederikvdv diederikvdv deleted the patch-1 branch January 10, 2025 15:07
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.

None yet

2 participants