[Python-Dev] an alternative to embedding policy in PEP 418

Ethan Furman ethan at stoneleaf.us
Fri Apr 6 16:40:06 CEST 2012

Oleg Broytman wrote:
> On Fri, Apr 06, 2012 at 11:57:20AM +0900, "Stephen J. Turnbull" <stephen at xemacs.org> wrote:
>> What I want to know is why you're willing to assert that absence of a
>> clock of a particular configuration is an Exception, when that absence
>> clearly documented to be a common case?
>    An error or not an error depends on how people will use the API. I
> usually don't like error codes -- people tend to ignore them or check
> lazily. If some library would do
>     (get_clock(THIS) or get_clock(THAT)).clock()
> I want to get a clearly defined and documented clock-related error, not
> some vague "AttributeError: 'NoneType' object has no attribute 'clock'".

The error won't be that vague -- it will include that offending line, 
making the problem easy to track.


More information about the Python-Dev mailing list