dbus-python 0.80pre1 test release

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Nov 17 11:37:27 PST 2006


On Thu, 16 Nov 2006 at 19:46:36 -0500, John (J5) Palmieri wrote:
> On Thu, 2006-11-16 at 20:08 +0000, Simon McVittie wrote:
> > * This also means dbus.Boolean is back, and is not a subclass of bool :-(
> 
> Why can't we subclass bool?

It's not declared as a valid base type in CPython (subclassing would
break the invariant that there are exactly two bool values, True and
False, aka Py_True and Py_False in the C API).

	>>> class Foo(bool):
	...     pass
	... 
	Traceback (most recent call last):
	  File "<stdin>", line 1, in ?
	  TypeError: Error when calling the metaclass bases
	      type 'bool' is not an acceptable base type

Regards,
	Simon


More information about the dbus mailing list