A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-April/118533.html below:

[Python-Dev] an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock)

[Python-Dev] an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) [Python-Dev] an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock)Ethan Furman ethan at stoneleaf.us
Thu Apr 5 22:49:11 CEST 2012
Oleg Broytman wrote:
> On Thu, Apr 05, 2012 at 11:56:00AM -0700, Ethan Furman wrote:
>> It's only an error if it's documented that way and, more
>> importantly, thought of that way.  The re module is a good example:
>> if it can't find what you're looking for it returns None -- it does
>> *not* raise a NotFound exception.
> 
>    But open() raises IOError. ''.find('a') returns -1 but ''.index('a')
> raises ValueError.
>    So we can argue in circles both ways, there are too many arguments
> pro and contra. Python is just too inconsistent to be consistently
> argued over. ;-)

Indeed -- I think we have reached an agreement!  Now if you'll just 
agree that returning None in this case is better... ;)

~Ethan~
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4