Skip to content

Commit 365b4f2

Browse files
committed
fix prov graph literal type value property
1 parent 78ef52d commit 365b4f2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mypy-stubs/rdflib/graph.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ from rdflib import query
1616
from rdflib.collection import Collection
1717
from rdflib.paths import Path
1818
from rdflib.resource import Resource
19-
from rdflib.term import BNode, Identifier, Node
19+
from rdflib.term import BNode, Identifier, Literal, Node
2020

2121
class Graph(Node):
2222
base: Any = ...
@@ -66,7 +66,7 @@ class Graph(Node):
6666
) -> Iterable[Node]: ...
6767
def objects(
6868
self, subject: Optional[Any] = ..., predicate: Optional[Any] = ...
69-
) -> Iterable[Identifier]: ...
69+
) -> Iterable[Union[Identifier, Literal]]: ...
7070
def subject_predicates(self, object: Optional[Any] = ...) -> None: ...
7171
def subject_objects(self, predicate: Optional[Any] = ...) -> None: ...
7272
def predicate_objects(self, subject: Optional[Any] = ...) -> None: ...

tests/test_provenance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ def check_prov(
573573
else:
574574
account_names = set(g.objects(account, FOAF.accountName))
575575
assert len(account_names) == 1
576-
account_name = account_names.pop()
576+
account_name = cast(Literal, account_names.pop())
577577
machine_user = provenance._whoami()[0]
578578
assert account_name.value == machine_user
579579

0 commit comments

Comments
 (0)