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.
Created on 2014年04月15日 06:06 by jayanthkoushik, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Messages (7) | |||
|---|---|---|---|
| msg216278 - (view) | Author: Jayanth Koushik (jayanthkoushik) | Date: 2014年04月15日 06:10 | |
In the difflib documentation, multiple uses of 'splitlines' use '1' as the 'keepends' argument. In Python 2.x, 1 is not guaranteed to be True and while this is guaranteed in 3.x, it would be much clearer to specify the argument as 'True'. |
|||
| msg216804 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2014年04月18日 20:55 | |
In 2.x, 1 is guaranteed to be true, in that sense that if 1: print 'true' is guaranteed to print 'true', while True is not necessarily true. >>> True = 0 >>> if True: print 'yes' >>> So 2.x docs should not be changed. |
|||
| msg216805 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2014年04月18日 21:01 | |
New changeset 604b74f9a07d by Terry Jan Reedy in branch '3.4': Issue #21232: Replace .splitlines arg '1' with 'keepends=True'. http://hg.python.org/cpython/rev/604b74f9a07d New changeset c82dcad83438 by Terry Jan Reedy in branch 'default': Merge with 3.4. Closes #21232. http://hg.python.org/cpython/rev/c82dcad83438 |
|||
| msg216808 - (view) | Author: Ned Batchelder (nedbat) * (Python triager) | Date: 2014年04月18日 21:35 | |
Although the OP was incorrect about 1 being guaranteed to be True, it is still better documentation to use True rather than 1 for a boolean argument. |
|||
| msg216825 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2014年04月19日 00:53 | |
I believe that there have been discussions on this point and my memory is to leave 1 alone in 2.x docs. I could be mistaken though. |
|||
| msg216920 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2014年04月20日 23:03 | |
I think that the general consensus is that changing the value of True and False is not supported, and the result of doing it is undefined, so I think Ned request is reasonable. |
|||
| msg216924 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2014年04月20日 23:54 | |
If you want to backport, go ahead. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:01 | admin | set | github: 65431 |
| 2014年04月20日 23:54:15 | terry.reedy | set | messages: + msg216924 |
| 2014年04月20日 23:03:07 | ezio.melotti | set | nosy:
+ ezio.melotti messages: + msg216920 |
| 2014年04月19日 00:53:02 | terry.reedy | set | messages: + msg216825 |
| 2014年04月18日 21:35:46 | nedbat | set | nosy:
+ nedbat messages: + msg216808 |
| 2014年04月18日 21:01:33 | python-dev | set | status: open -> closed nosy: + python-dev messages: + msg216805 resolution: fixed stage: resolved |
| 2014年04月18日 20:55:23 | terry.reedy | set | assignee: docs@python -> terry.reedy |
| 2014年04月18日 20:55:12 | terry.reedy | set | nosy:
+ terry.reedy messages: + msg216804 versions: - Python 3.1, Python 2.7, Python 3.2, Python 3.3 |
| 2014年04月15日 06:10:31 | jayanthkoushik | set | messages: + msg216278 |
| 2014年04月15日 06:06:37 | jayanthkoushik | create | |