From 259c10db10e5ead9f48da007cf30d28af1c9b9a9 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Sun, 26 Mar 2023 21:03:18 +0200 Subject: [PATCH] Revert optionals --- rdflib/plugins/sparql/processor.py | 16 ++++++++-------- rdflib/plugins/sparql/update.py | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/rdflib/plugins/sparql/processor.py b/rdflib/plugins/sparql/processor.py index f10f372bc..68f5ee545 100644 --- a/rdflib/plugins/sparql/processor.py +++ b/rdflib/plugins/sparql/processor.py @@ -20,7 +20,7 @@ def prepareQuery( queryString: str, - initNs: Optional[Mapping[str, Any]] = None, + initNs: Optional[Mapping[str, Any]] = {}, base: Optional[str] = None, ) -> Query: """ @@ -35,7 +35,7 @@ def prepareQuery( def prepareUpdate( updateString: str, - initNs: Optional[Mapping[str, Any]] = None, + initNs: Optional[Mapping[str, Any]] = {}, base: Optional[str] = None, ) -> Update: """ @@ -51,8 +51,8 @@ def prepareUpdate( def processUpdate( graph: Graph, updateString: str, - initBindings: Optional[Mapping[str, Identifier]] = None, - initNs: Optional[Mapping[str, Any]] = None, + initBindings: Optional[Mapping[str, Identifier]] = {}, + initNs: Optional[Mapping[str, Any]] = {}, base: Optional[str] = None, ) -> None: """ @@ -81,8 +81,8 @@ def __init__(self, graph): def update( self, strOrQuery: Union[str, Update], - initBindings: Optional[Mapping[str, Identifier]] = None, - initNs: Optional[Mapping[str, Any]] = None, + initBindings: Optional[Mapping[str, Identifier]] = {}, + initNs: Optional[Mapping[str, Any]] = {}, ) -> None: """ .. caution:: @@ -116,8 +116,8 @@ def __init__(self, graph): def query( # type: ignore[override] self, strOrQuery: Union[str, Query], - initBindings: Optional[Mapping[str, Identifier]] = None, - initNs: Optional[Mapping[str, Any]] = None, + initBindings: Optional[Mapping[str, Identifier]] = {}, + initNs: Optional[Mapping[str, Any]] = {}, base: Optional[str] = None, DEBUG: bool = False, ) -> Mapping[str, Any]: diff --git a/rdflib/plugins/sparql/update.py b/rdflib/plugins/sparql/update.py index 5ce86f393..5de59836a 100644 --- a/rdflib/plugins/sparql/update.py +++ b/rdflib/plugins/sparql/update.py @@ -282,7 +282,7 @@ def evalCopy(ctx: QueryContext, u: CompValue) -> None: def evalUpdate( graph: Graph, update: Update, - initBindings: Optional[Mapping[str, Identifier]] = None, + initBindings: Optional[Mapping[str, Identifier]] = {}, ) -> None: """