[issue29935] list and tuple index methods should accept None parameters

2017-03-30 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ _

[issue29935] list and tuple index methods should accept None parameters

2017-03-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 079f21f873b99f9564a41c5b7f3e0d7035847ae5 by Serhiy Storchaka in branch '2.7': bpo-29935: Fixed error messages in the index() method of tuple and list (#887) (#907) (#910) https://github.com/python/cpython/commit/079f21f873b99f9564a41c5b7f3e0d70

[issue29935] list and tuple index methods should accept None parameters

2017-03-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 8b8bde44f3912d8b2df5591ffc31d2d8c6dcca6c by Serhiy Storchaka in branch '3.5': bpo-29935: Fixed error messages in the index() method of tuple, list and deque (#887) (#907) (#909) https://github.com/python/cpython/commit/8b8bde44f3912d8b2df5591ff

[issue29935] list and tuple index methods should accept None parameters

2017-03-30 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +810 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue29935] list and tuple index methods should accept None parameters

2017-03-30 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +809 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue29935] list and tuple index methods should accept None parameters

2017-03-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset bf4bb2e43030661e568d5d4b046e8b9351cc164c by Serhiy Storchaka in branch '3.6': bpo-29935: Fixed error messages in the index() method of tuple, list and deque (#887) (#907) https://github.com/python/cpython/commit/bf4bb2e43030661e568d5d4b046e8b93

[issue29935] list and tuple index methods should accept None parameters

2017-03-30 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +807 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue29935] list and tuple index methods should accept None parameters

2017-03-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset d4edfc9abffca965e76ebc5957a92031a4d6c4d4 by Serhiy Storchaka in branch 'master': bpo-29935: Fixed error messages in the index() method of tuple, list and deque (#887) https://github.com/python/cpython/commit/d4edfc9abffca965e76ebc5957a92031a4d6

[issue29935] list and tuple index methods should accept None parameters

2017-03-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Raymond for your review. In any case we should first fix error messages in maintain releases. Changing signatures of methods of basic type should be discussed on the mailing lists. I don't think this needs a PEP, unless this change will be extended

[issue29935] list and tuple index methods should accept None parameters

2017-03-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sorry, modifying these mature APIs is a really bad idea. They are worked well as-is of over a decade. Seeing people use None for these arguments makes the code less readable. Python has a number of APIs where the number of arguments controls the behavio

[issue29935] list and tuple index methods should accept None parameters

2017-03-29 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I agree with George that supporting None here is the better option. This problem also applies to collections.deque. tuple, list, and deque all have very similar index implementations, and it would be nice to merge their argument parsing boilerplate. -

[issue29935] list and tuple index methods should accept None parameters

2017-03-29 Thread George King
George King added the comment: I think it is a mistake not to support None values. Please consider: The existing message clearly suggests that the intent is to support the same set of values as the start/stop parameters of the slice type. str, bytes, and bytearray all support None for `index`,

[issue29935] list and tuple index methods should accept None parameters

2017-03-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +789 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue29935] list and tuple index methods should accept None parameters

2017-03-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Raymond. Proposed patch fixes error messages and doesn't change the public API. -- stage: -> patch review type: enhancement -> behavior versions: +Python 2.7, Python 3.5, Python 3.6 ___ Python tracke

[issue29935] list and tuple index methods should accept None parameters

2017-03-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: The error message should be fixed and the API should be left alone. A *None* value doesn't do a good jog of communicating intent. -- nosy: +rhettinger ___ Python tracker _

[issue29935] list and tuple index methods should accept None parameters

2017-03-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list ma

[issue29935] list and tuple index methods should accept None parameters

2017-03-28 Thread George King
Changes by George King : -- type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue29935] list and tuple index methods should accept None parameters

2017-03-28 Thread Jim Fasarakis-Hilliard
Changes by Jim Fasarakis-Hilliard : -- components: +Interpreter Core versions: +Python 3.7 ___ Python tracker ___ ___ Python-bugs-list

[issue29935] list and tuple index methods should accept None parameters

2017-03-28 Thread George King
New submission from George King: As of python3.6, passing None to the start/end parameters of `list.index` and `tuple.index` raises the following exception: "slice indices must be integers or None or have an __index__ method" This suggests that the intent is to support None as a valid input. Th