not_implemented_for#

not_implemented_for(*graph_types)[源代码]#

装饰器将算法标记为未实现

参数
graph_types字符串的容器

条目必须是“有向图”、“无向图”、“多图”或“图”之一。

返回
_require功能

装饰过的功能。

加薪
NetworkXNotImplemented
如果有任何包无法导入

笔记

多个类型逻辑上与“and”连接。对于“或”使用多个@not_implemented_for()行。

实例

这样的装饰功能:

@not_implemented_for("directed")
def sp_function(G):
    pass

# rule out MultiDiGraph
@not_implemented_for("directed","multigraph")
def sp_np_function(G):
    pass

# rule out all except DiGraph
@not_implemented_for("undirected")
@not_implemented_for("multigraph")
def sp_np_function(G):
    pass