Letractively / rdflib

Automatically exported from code.google.com/p/rdflib
Other
0 stars 0 forks source link

Literal repr mishandles the input kw arg names #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
>>> Literal('2008-12-18',
datatype=URIRef('http://www.w3.org/2001/XMLSchema#date'))
rdflib.Literal('2008-12-18', language=None,
datatype=rdflib.URIRef('http://www.w3.org/2001/XMLSchema#date'))

The language=None part isn't wrong, but it does make my doctest lines extra
long. 

>>> Literal('bonjour', lang='fr')
rdflib.Literal('bonjour', language='fr', datatype=None)

That one is much worse, because the repr does not eval back to the object
(lang vs language). Similarly, I wish it would omit the datatype=None.

Original issue reported on code.google.com by drewpca on 19 Dec 2008 at 6:42

GoogleCodeExporter commented 9 years ago

Original comment by drewpca on 19 Dec 2008 at 6:43

GoogleCodeExporter commented 9 years ago
Literal's __repr__ was changed from language to lang in r1139; which is now 
consistent with the __init__ method. 
The __repr__ no longer includes lang or datatype if they are None. See r1470.

Original comment by eik...@gmail.com on 11 Feb 2009 at 11:24