Preventing class methods from being defined

Steven D'Aprano steve at REMOVETHIScyber.com.au
Mon Jan 16 11:53:28 EST 2006


On Mon, 16 Jan 2006 06:39:48 -0500, Dan Sommers wrote:

> By the principle of least surprise, if dir(some_sobject) contains foo,
> then some_object.foo should *not* raise a NameError.

Good thinking. Yes, it should raise a different exception.

-- 
Steven.




More information about the Python-list mailing list