本文整理汇总了Python中sage.graphs.graph.Graph.__getattribute__方法的典型用法代码示例。如果您正苦于以下问题:Python Graph.__getattribute__方法的具体用法?Python Graph.__getattribute__怎么用?Python Graph.__getattribute__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.graphs.graph.Graph
的用法示例。
在下文中一共展示了Graph.__getattribute__方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _graphattr
# 需要导入模块: from sage.graphs.graph import Graph [as 别名]
# 或者: from sage.graphs.graph.Graph import __getattribute__ [as 别名]
def _graphattr(store=False, *largs, **kargs):
default = len(largs) + len(kargs) == 0
try:
if not default:
raise NotImplementedError
return lookup(self._props, name)
except (KeyError, NotImplementedError):
a = Graph.__getattribute__(self, name)(*largs, **kargs)
if default and store:
update(self._props, attr, d)
return a
示例2: __getattribute__
# 需要导入模块: from sage.graphs.graph import Graph [as 别名]
# 或者: from sage.graphs.graph.Graph import __getattribute__ [as 别名]
def __getattribute__(self, name):
def _graphattr(store=False, *largs, **kargs):
default = len(largs) + len(kargs) == 0
try:
if not default:
raise NotImplementedError
return lookup(self._props, name)
except (KeyError, NotImplementedError):
a = Graph.__getattribute__(self, name)(*largs, **kargs)
if default and store:
update(self._props, attr, d)
return a
attr = Graph.__getattribute__(self, name)
cl = type(self)
while cl is not None:
if name in cl._spec["fields"] and name not in cl._spec["skip"] and name not in cl._spec["special"]:
_graphattr.func_name = name
_graphattr.func_doc = attr.func_doc
return _graphattr
cl = cl._parent
return attr