1313 ClassVar ,
1414 Iterable ,
1515 Optional ,
16+ Type ,
1617 TypeVar ,
1718 cast ,
1819)
@@ -376,7 +377,7 @@ def get_edges(
376377 self ,
377378 dir : EdgeDir ,
378379 filter_func : Optional [Callable [[list [EdgeArchitype ]], list [EdgeArchitype ]]],
379- target_obj : Optional [list [NodeArchitype ]],
380+ target_cls : Optional [list [Type [ NodeArchitype ] ]],
380381 ) -> list [EdgeArchitype ]:
381382 """Get edges connected to this node."""
382383 ret_edges : list [EdgeArchitype ] = []
@@ -394,15 +395,15 @@ def get_edges(
394395 dir in [EdgeDir .OUT , EdgeDir .ANY ]
395396 and self == source
396397 and trg_arch
397- and (not target_obj or trg_arch in target_obj )
398+ and (not target_cls or trg_arch . __class__ in target_cls )
398399 and source .has_read_access (target )
399400 ):
400401 ret_edges .append (architype )
401402 if (
402403 dir in [EdgeDir .IN , EdgeDir .ANY ]
403404 and self == target
404405 and src_arch
405- and (not target_obj or src_arch in target_obj )
406+ and (not target_cls or src_arch . __class__ in target_cls )
406407 and target .has_read_access (source )
407408 ):
408409 ret_edges .append (architype )
@@ -412,7 +413,7 @@ def edges_to_nodes(
412413 self ,
413414 dir : EdgeDir ,
414415 filter_func : Optional [Callable [[list [EdgeArchitype ]], list [EdgeArchitype ]]],
415- target_obj : Optional [list [NodeArchitype ]],
416+ target_cls : Optional [list [Type [ NodeArchitype ] ]],
416417 ) -> list [NodeArchitype ]:
417418 """Get set of nodes connected to this node."""
418419 ret_edges : list [NodeArchitype ] = []
@@ -430,15 +431,15 @@ def edges_to_nodes(
430431 dir in [EdgeDir .OUT , EdgeDir .ANY ]
431432 and self == source
432433 and trg_arch
433- and (not target_obj or trg_arch in target_obj )
434+ and (not target_cls or trg_arch . __class__ in target_cls )
434435 and source .has_read_access (target )
435436 ):
436437 ret_edges .append (trg_arch )
437438 if (
438439 dir in [EdgeDir .IN , EdgeDir .ANY ]
439440 and self == target
440441 and src_arch
441- and (not target_obj or src_arch in target_obj )
442+ and (not target_cls or src_arch . __class__ in target_cls )
442443 and target .has_read_access (source )
443444 ):
444445 ret_edges .append (src_arch )
0 commit comments