[Bf-python] OT: *_dealloc functions
Stephen Swaney
sswaney at centurytel.net
Thu Mar 15 03:17:38 CET 2007
On Wed, Mar 14, 2007 at 09:52:07AM -0700, Ken Hughes wrote:
> While playing around, I wondered what would happen if I didn't define a
> foo_dealloc() function for a new type and then called PyType_Ready. As
> I expected, an entry was created in the tp_dealloc slot which I assume
> is the general Python object deallocation function.
>
> So might I suggest we save a little space and not declare those local
> dealloc functions unless they're really needed (i.e., the object has its
> own allocated memory), as long as the type initialization is done with
> PyType_Ready?
Yeah, no sense in writing code we don't need.
IIRC, some of our objects *do* allocate some mem, but those
are the Exception (heh).
As for the object Type check question, in your other msg, I kinda
sorta like the macro version.
--
Stephen Swaney
sswaney at centurytel.net
More information about the Bf-python
mailing list