Preventing class methods from being defined

Steven D'Aprano steve at
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 should *not* raise a NameError.

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


More information about the Python-list mailing list