Skip to content

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.

2 participants