Implicit initialization is EXCELLENT

Steven D'Aprano steve+comp.lang.python at pearwood.info
Wed Jul 6 19:40:44 EDT 2011


Stefaan Himpe wrote:

> 
>> No! I was serious. I've spent *ages* trying to find the link to the
>> article... if you know it, please share.
> 
> Ok - I thought you were referring to some troll's rant with similar
> title. I'm probably way off, but were you referring to the RAII technique?
> 
> http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization

Thanks Stefaan, but although it *sounds* like it should be from the title,
that's not the idea I'm talking about. Despite the name, RAII is more about
destructor/finalizer methods than initialisation. The blog post I'm looking
for is not about finalizers, but about API design: don't make the caller
give an explicit second activation call if you don't need to.



-- 
Steven




More information about the Python-list mailing list