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

Optional size argument for readline() #59654

Closed
Sworddragon mannequin opened this issue Jul 25, 2012 · 2 comments
Closed

Optional size argument for readline() #59654

Sworddragon mannequin opened this issue Jul 25, 2012 · 2 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@Sworddragon
Copy link
Mannequin

Sworddragon mannequin commented Jul 25, 2012

BPO 15449
Nosy @pitrou

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2012-07-25.20:35:31.971>
created_at = <Date 2012-07-25.20:15:47.709>
labels = ['type-feature', 'library']
title = 'Optional size argument for readline()'
updated_at = <Date 2012-07-25.20:35:31.970>
user = 'https://bugs.python.org/Sworddragon'

bugs.python.org fields:

activity = <Date 2012-07-25.20:35:31.970>
actor = 'pitrou'
assignee = 'none'
closed = True
closed_date = <Date 2012-07-25.20:35:31.971>
closer = 'pitrou'
components = ['Library (Lib)']
creation = <Date 2012-07-25.20:15:47.709>
creator = 'Sworddragon'
dependencies = []
files = []
hgrepos = []
issue_num = 15449
keywords = []
message_count = 2.0
messages = ['166422', '166424']
nosy_count = 2.0
nosy_names = ['pitrou', 'Sworddragon']
pr_nums = []
priority = 'normal'
resolution = 'works for me'
stage = None
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue15449'
versions = ['Python 3.2']

@Sworddragon
Copy link
Mannequin Author

Sworddragon mannequin commented Jul 25, 2012

For file objects the read() function has the optional size argument to limit the data that will be read. I'm wondering why there isn't such an argument for readline(). Theoretically lines in a file could have million of characters and even much more. An optional limit could prevent that a high amount of data will be load into the memory.

@Sworddragon Sworddragon mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Jul 25, 2012
@pitrou
Copy link
Member

pitrou commented Jul 25, 2012

Well, it does:
http://docs.python.org/dev/library/io.html#io.IOBase.readline

“readline(limit=-1)

Read and return one line from the stream. If limit is specified, at most limit bytes will be read.”

@pitrou pitrou closed this as completed Jul 25, 2012
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant