On 5/9/2013 1:23 AM, Steven D'Aprano wrote:

Besides, this is not to denigrate the idea of a read() function that
takes a filename and returns its contents. But that is not an object
constructor. It may construct a file object internally, but it doesn't
return the file object, so it is completely unrelated to the scenario I
described.

At least a few stdlib modules that define classes *also* have such functions. They create an instance of the class, call one or more methods, and return the result of the method, discarding the instance. For instance, see the subprocess module, its POpen class, and module functions; or the timeit module, its Timer class, and functions.


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to