[issue40531] Adding the method find() to list

2020-05-06 Thread João Marcos
João Marcos added the comment: Thanks for the replies!. Here's the link for discussion in the Python Ideas: https://discuss.python.org/t/adding-the-method-find-to-list/4113 -- ___ Python tracker <https://bugs.python.org/is

[issue40531] Adding the method find() to list

2020-05-06 Thread João Marcos
João Marcos added the comment: This is my first issue, is this the right place to discuss enhancements? -- components: +Library (Lib) ___ Python tracker <https://bugs.python.org/issue40

[issue40531] Adding the method find() to list

2020-05-06 Thread João Marcos
New submission from João Marcos : """ PROBLEM: When trying to search the position of an element inside a list, we should use the `in` operator to first check if the element exists, and then use the `index` method to obtain the index. `in` (__contains__) runs a linear searc