On Fri, 21 Sep 2007 10:47:02 -0400, Steve Holden wrote:
[snippity-doo-dah]
>> but of course __init__ is automatically called.
>>
>>
>> Any suggestions for doing something like this?
>>
>>
> Easy: use a method whose name is something other than __init__, then
> don't bother to implement __init
Steven D'Aprano <[EMAIL PROTECTED]> writes:
> I can construct an empty instance in the __new__ constructor, and I
> can initialize an non-empty instance in the __init__ initializer,
> but I can't think of any good way to stop __init__ from being called
> if the instance is empty. In pseudo-code, I
Steven D'Aprano wrote:
> I have a class that has a distinct "empty" state. In the empty state, it
> shouldn't have any data attributes, but it should still have methods.
>
> The analogy is with a list: an empty list still has methods like append()
> etc. but it has no "data", if by data you mean