(The following is written presuming that when you write return an
error, you mean to raise an exception.)
Actually, not providing an interface will also raise an exception when
used. The advantage over providing the interface on all systems but
raising an exception when it can't be implemented is that the caller
can test for the presence of the interface (e.g. by using hasattr(f,
'lock')).
--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>