End of file

Andrew Dalke adalke at mindspring.com
Fri Oct 8 13:39:04 EDT 2004


Alex:
> Yes, 2.2 is when Python acquired the 'object' built-in.  If you need to
> also support ancient versions of Python, it's often possible to do so by
> clever initialization -- substituting your own coding if at startup you
> find you're running under too-old versions.

I've used

class sentinel:
   pass


I didn't realized

sentinel = object()

was the new and improved way to do it.

Regarding timings, class def is slower than either [] or
object(), but in any case it's only done once in
module scope.

				Andrew
				dalke at dalkescientific.com




More information about the Python-list mailing list