This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: help(open('/dev/zero').writelines) gives no help
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.6
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, jfine2358, paul.moore, zach.ware
Priority: normal Keywords:

Created on 2021-07-13 14:48 by jfine2358, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (5)
msg397414 - (view) Author: Jonathan Fine (jfine2358) * Date: 2021-07-13 14:48
On Linux
>>> help(open('/dev/zero').writelines)
gives
<built-in method writelines of _io.TextIOWrapper object at 0x7fed03d4e558>

However
https://docs.python.org/3/library/io.html#io.IOBase.writelines
gives

Write a list of lines to the stream. Line separators are not added, so it is usual for each of the lines provided to have a line separator at the end.

See also request that writelines support a line separator.
https://mail.python.org/archives/list/python-ideas@python.org/thread/A5FT7SVZBYAJJTIWQFTFUGNSKMVQNPVF/#A5FT7SVZBYAJJTIWQFTFUGNSKMVQNPVF
msg397415 - (view) Author: Paul Moore (paul.moore) * (Python committer) Date: 2021-07-13 15:00
It does for me:

>>> help(open("nul").writelines)
Help on built-in function writelines:

writelines(lines, /) method of _io.TextIOWrapper instance
    Write a list of lines to stream.

    Line separators are not added, so it is usual for each of the
    lines provided to have a line separator at the end.

This is Windows, Python 3.9. What version did you get the problem with? If it's older, I'd say the problem has likely since been fixed.
msg397419 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2021-07-13 15:46
I also can't reproduce this with a fresh build of 3b5b99da4b on Linux.
msg397420 - (view) Author: Jonathan Fine (jfine2358) * Date: 2021-07-13 15:50
I used my default Python, which is Python 3.6. However, with 3.7 and 3.8 I get the same as Paul.

So I'm closing this as 'not a bug' (as there's not an already-fixed option for closing).
msg397426 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2021-07-13 16:18
Even with 3.6 I get a different result:

```
Python 3.6.13 (tags/v3.6.13:aa73e1722e, Mar 23 2021, 15:45:49) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> help(open('/dev/zero').writelines)
Help on built-in function writelines:

writelines(lines, /) method of _io.TextIOWrapper instance

```

This appears to be because TextIOWrapper.writelines just didn't have a docstring in 3.6.  I can't explain why `help` just gave you the repr of the method, though.
History
Date User Action Args
2022-04-11 14:59:47adminsetgithub: 88789
2021-07-13 16:18:29zach.waresetversions: + Python 3.6, - Python 3.11
2021-07-13 16:18:09zach.waresetstatus: open -> closed
resolution: not a bug -> works for me
messages: + msg397426

stage: resolved
2021-07-13 15:50:11jfine2358setstatus: pending -> open
resolution: works for me -> not a bug
messages: + msg397420
2021-07-13 15:46:38zach.waresetstatus: open -> pending

nosy: + zach.ware
messages: + msg397419

resolution: works for me
2021-07-13 15:00:25paul.mooresetnosy: + paul.moore
messages: + msg397415
2021-07-13 14:48:39jfine2358create