gjhiggins/rdflib — Issue #87: Literal(True) creates literals of type xsd:integer not xsd:boolean
Author: gjhiggins
Created: 2011-10-19 01:16:50+00:00
State: open

Originally filed by cuu...@gmail.com on 2009-10-29T12:57:32

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