@@ -460,20 +460,23 @@ def _to_object(
460
460
term : Optional [Term ],
461
461
node : Any ,
462
462
inlist : bool = False ,
463
- ):
463
+ ) -> Optional [ Node ] :
464
464
if isinstance (node , tuple ):
465
465
value , lang = node
466
466
if value is None :
467
- return
467
+ # type error: Return value expected
468
+ return # type: ignore[return-value]
468
469
if lang and " " in lang :
469
- return
470
+ # type error: Return value expected
471
+ return # type: ignore[return-value]
470
472
return Literal (value , lang = lang )
471
473
472
474
if isinstance (node , dict ):
473
475
node_list = context .get_list (node )
474
476
if node_list is not None :
475
477
if inlist and not self .allow_lists_of_lists :
476
- return
478
+ # type error: Return value expected
479
+ return # type: ignore[return-value]
477
480
listref = self ._add_list (dataset , graph , context , term , node_list )
478
481
if listref :
479
482
return listref
@@ -483,7 +486,8 @@ def _to_object(
483
486
if term .type == JSON :
484
487
node = self ._to_typed_json_value (node )
485
488
elif node is None :
486
- return
489
+ # type error: Return value expected
490
+ return # type: ignore[return-value]
487
491
elif term .type == ID and isinstance (node , str ):
488
492
node = {ID : context .resolve (node )}
489
493
elif term .type == VOCAB and isinstance (node , str ):
@@ -492,7 +496,8 @@ def _to_object(
492
496
node = {TYPE : term .type , VALUE : node }
493
497
else :
494
498
if node is None :
495
- return
499
+ # type error: Return value expected
500
+ return # type: ignore[return-value]
496
501
if isinstance (node , float ):
497
502
return Literal (node , datatype = XSD .double )
498
503
@@ -516,7 +521,8 @@ def _to_object(
516
521
return None
517
522
if lang :
518
523
if " " in lang :
519
- return
524
+ # type error: Return value expected
525
+ return # type: ignore[return-value]
520
526
return Literal (value , lang = lang )
521
527
elif datatype :
522
528
return Literal (value , datatype = context .expand (datatype ))
@@ -549,7 +555,7 @@ def _add_list(
549
555
context : Context ,
550
556
term : Optional [Term ],
551
557
node_list : Any ,
552
- ):
558
+ ) -> IdentifiedNode :
553
559
if not isinstance (node_list , list ):
554
560
node_list = [node_list ]
555
561
0 commit comments