1 Star 1 Fork 0

zhangpengju/pygraph

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
exceptions.py 821 Bytes
一键复制 编辑 原始数据 按行查看 历史
"""Exceptions used by the library."""
class PygraphError(Exception):
"""Root exception class for all library exceptions. Only used for subclassing."""
pass
class NonexistentNodeError(PygraphError):
"""Thrown when a node does not exist within a graph."""
def __init__(self, node_id):
self.node_id = node_id
def __str__(self):
return 'Node "{}" does not exist.'.format(self.node_id)
class NonexistentEdgeError(PygraphError):
"""Thrown when an edge does not exist within a graph."""
def __init__(self, edge_id):
self.edge_id = edge_id
def __str__(self):
return 'Edge "{}" does not exist.'.format(self.edge_id)
class DisconnectedGraphError(PygraphError):
"""Thrown when a graph is disconnected (and such is unexpected by an algorithm)."""
pass
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangpengju/pygraph.git
[email protected]:zhangpengju/pygraph.git
zhangpengju
pygraph
pygraph
master

搜索帮助