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/118486.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
Wed Apr 4 20:06:50 CEST 2012
Georg Brandl wrote:
> Am 04.04.2012 18:18, schrieb Ethan Furman:
>> Lennart Regebro wrote:
>>> On Tue, Apr 3, 2012 at 18:07, Ethan Furman <ethan at stoneleaf.us> wrote:
>>>> What's unclear about returning None if no clocks match?
>>> Nothing, but having to check error values on return functions are not
>>> what you typically do in Python. Usually, Python functions that fail
>>> raise an error. Please don't force Python users to write pseudo-C code
>>> in Python.
>> You mean like the dict.get() function?
>>
>> --> repr({}.get('missing'))
>> 'None'
> 
> Strawman: this is not a failure.

Also not a very good example -- if 'missing' was there with a value of 
None the two situations could not be distinguished with the one call.

At any rate, the point is that there is nothing inherently wrong nor 
unPythonic about a function returning None instead of raising an exception.

~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