New public Graph.revision_relation method

Martin von Gagern Martin.vGagern at gmx.net
Wed Dec 9 18:24:22 GMT 2009


John Arbash Meinel wrote:
> You may also want to look at the KnownGraph code.

I had encountered KnownGraph before. Originally I had assumed that
KnownGraph would be a specialization of Graph, so that any wrapper
method added top Graph would become available to KnownGraph as well.

It seems I was wrong; KnownGraph inherits directly from object in the
pure python version, and a basic cdef class in the Pyrex version. So
while it looks like its heads implementation already does all the
optimization a proper find_relation would need, I'd either have to copy
the implementation, come up with some clever inheritance scheme, or
simply leave find_relation restricted to either graph implementation for
the time being.

I guess I'd favor a mltiple inheritance mechanism. Have some
AbstractGraph to provide common wrapper functions, some RawKnownGraph to
provide the Pyrex implementation, and then let Graph inherit from
AbstractGraph and KnownGraph inherit from both RawKnownGraph and
AbstractGraph. What do you think?

Martin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20091209/b823146f/attachment.pgp 


More information about the bazaar mailing list