RDFLib/rdflib — Issue #82: Literal(True) creates literals of type xsd:integer not xsd:boolean
Author: gjhiggins
Created: 2012-02-20 08:32:15+00:00
State: open

cuu...@gmail.com, 2009-10-29T12:57:32.000Z

What steps will reproduce the problem?
1. print Literal(True).datatype

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

Datatype should be xsd:boolean but it is xsd:integer. This bug is related
to the fact that in python "bool" is subclass of "int", and Literal first
does "isinstance(obj, int)" and only then "isinstance(obj, bool)". Patch
attached.

What version of the product are you using? On what operating system?

rdflib 2.4.2. This issue seems to be already fixed in 2.5.x

Comment 1 by eik...@gmail.com

Comment 2 by eik...@gmail.com

Comment 3 by eik...@gmail.com

Comment 4 by eik...@gmail.com
This issue was closed by revision r1753.

Comment 5 by eik...@gmail.com
This issue was closed by revision 9391f9cd457c.