gjhiggins/rdflib — Issue #25: Add/Sub/Mul operators traceback
Author: gjhiggins
Created: 2011-10-19 00:58:06+00:00
State: open
Labels: Type-Defect

Originally filed by azarot...@gmail.com on 2008-05-07T13:58:27

What steps will reproduce the problem?
1. Create two ConjunctiveGraphs, a and b
2. Add some triples to each
3. Try to add them together: c = a + b

What is the expected output? What do you see instead?

Expected: Create new graph called c.

Actual:
Traceback (most recent call last):
File "", line 1, in
File "build/bdist.linux-i686/egg/rdflib/Graph.py", line 406, in __add__
AttributeError: 'ConjunctiveGraph' object has no attribute 'graph'

What version of the product are you using? On what operating system?
2.4.0, Linux, Python 2.5.2

Please provide any additional information below.

The += operator on graphs works as expected, as it does not use the
non-existant .graph property.

Suggested Fix:

__add__, __mul__ and __sub__ should use the same triple iteration as
__iadd__ function