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: 2to3 docs: example of fix for duplicates in second argument of isinstance has superfluous parentheses
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Eli_B, berker.peksag, docs@python
Priority: normal Keywords: patch

Created on 2017-05-24 12:38 by Eli_B, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
2to3.rst Eli_B, 2017-05-24 12:37
Pull Requests
URL Status Linked Edit
PR 1699 merged Eli_B, 2017-05-24 12:37
PR 4531 merged berker.peksag, 2017-11-23 20:21
Messages (4)
msg294351 - (view) Author: Eli_B (Eli_B) * Date: 2017-05-24 12:37
The documentation says isinstance(x, (int, int)) would be fixed to isinstance(x, (int)). The fix is actually isinstance(x, int).

I propose the following text instead:
"
2to3fixer:: isinstance

Fixes duplicate types in the second argument of :func:`isinstance`.  For example, isinstance(x, (int, int)) is converted to isinstance(x, int) and isinstance(x, (int, float, int)) is converted to isinstance(x, (int, float)).
"
msg298923 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-07-24 00:39
New changeset 26248ef58dcf49619930ffa2e050ffa687a88601 by Berker Peksag (Eli Boyarski) in branch 'master':
bpo-30456: Clarify example for duplicates in second argument of isinstance (GH-1699)
https://github.com/python/cpython/commit/26248ef58dcf49619930ffa2e050ffa687a88601
msg306857 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-11-23 20:27
New changeset a645b23ffc76073a2eb4e77b88cb7648cfc6ef77 by Berker Peksag in branch '3.6':
bpo-30456: Clarify example for duplicates in second argument of isinstance (GH-1699)
https://github.com/python/cpython/commit/a645b23ffc76073a2eb4e77b88cb7648cfc6ef77
msg306858 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-11-23 20:28
Looks like I forgot to backport this 3.6 branch. Now it's done. Thanks, Eli.
History
Date User Action Args
2022-04-11 14:58:46adminsetgithub: 74641
2017-11-23 20:28:32berker.peksagsetstatus: open -> closed
versions: - Python 2.7, Python 3.5
messages: + msg306858

resolution: fixed
stage: patch review -> resolved
2017-11-23 20:27:27berker.peksagsetmessages: + msg306857
2017-11-23 20:21:40berker.peksagsetkeywords: + patch
stage: backport needed -> patch review
pull_requests: + pull_request4466
2017-07-24 00:39:49berker.peksagsetstage: backport needed
type: behavior
versions: + Python 3.5, Python 3.6, Python 3.7
2017-07-24 00:39:10berker.peksagsetnosy: + berker.peksag
messages: + msg298923
2017-05-24 12:38:00Eli_Bcreate