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

Docstring for numpy.load() incorrectly describes "file-like object" requirements. #2807

Closed
abingham opened this issue Dec 12, 2012 · 0 comments · Fixed by #4376
Closed

Docstring for numpy.load() incorrectly describes "file-like object" requirements. #2807

abingham opened this issue Dec 12, 2012 · 0 comments · Fixed by #4376

Comments

@abingham
Copy link

numpy.load() says that the file parameter must support seek() and read(). However, in the event that pickle.load() is invoked on the file (i.e. via the _cload() function), the file must also support readline(). According to the pickle documentation (and based on my actual experience), the pickle.load() requirements on the file-like object are:

The file-like object must have two methods, a read() method
that takes an integer argument, and a readline() method that
requires no arguments.

So, it seems that the numpy.load() docstring should be updated to indicate this somehow.

evanwalter added a commit to evanwalter/numpy that referenced this issue Jun 28, 2013
charris added a commit to charris/numpy that referenced this issue Feb 27, 2014
Add the fact that for pickled files, a file-like object must also
support the readline() method.

Closes numpy#2807.
charris referenced this issue Mar 1, 2014
DOC: Improve the documentation of numpy.load.
charris added a commit to charris/numpy that referenced this issue Mar 1, 2014
Add the fact that for pickled files, a file-like object must also
support the readline() method.

Closes numpy#2807.
charris added a commit to charris/numpy that referenced this issue Mar 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants