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.

Author rhettinger
Recipients larry, martin.panter, mdk, rhettinger, serhiy.storchaka, vstinner
Date 2016-11-28.16:16:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Sorry Julien, you don't to decide that long-standing APIs that have worked just fine for users are now a bad practice.  Some of these APIs (range, dict.pop, type) we designed by Guido and work fine in practice.  The expression, "don't have the tail wag the dog" comes to mind (where "tail" is the existing successful language and "dog" is the argument clinic).  Besides, API change is very disruptive to users (especially those trying to migrate to Python 3).

For the case of bisect, I've given a way forward.  It is okay to make the documented default value for "hi" to be "None" while internally still allowing -1 so that we don't break code that happens to depend on it.  In the clinic, use "hi: 'O' = None".  Then in the dispatch code, handle both the None case and the numeric case (see islice_new() in itertoolsmodule.c for some ideas on how to do this.

What isn't okay is to document and expose "hi=-1" because that is a confusing and error-prone default value that is just an awkward hack to express "hi=len(a)".
Date User Action Args
2016-11-28 16:16:14rhettingersetrecipients: + rhettinger, vstinner, larry, martin.panter, serhiy.storchaka, mdk
2016-11-28 16:16:14rhettingersetmessageid: <>
2016-11-28 16:16:14rhettingerlinkissue28754 messages
2016-11-28 16:16:14rhettingercreate