本文整理汇总了Python中logilab.astng.MANAGER.astng_from_class方法的典型用法代码示例。如果您正苦于以下问题:Python MANAGER.astng_from_class方法的具体用法?Python MANAGER.astng_from_class怎么用?Python MANAGER.astng_from_class使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类logilab.astng.MANAGER
的用法示例。
在下文中一共展示了MANAGER.astng_from_class方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GeneratorExit
# 需要导入模块: from logilab.astng import MANAGER [as 别名]
# 或者: from logilab.astng.MANAGER import astng_from_class [as 别名]
try:
GeneratorExit # introduced in py2.5
except NameError:
class GeneratorExit(Exception): pass
from logilab.astng import MANAGER, _nodes as nodes, raw_building
from logilab.astng import ASTNGError, InferenceError, UnresolvableName, \
NoDefault, NotFoundError, ASTNGBuildingException
from logilab.astng.infutils import YES, Instance, InferenceContext, \
_infer_stmts, copy_context, path_wrapper, raise_if_nothing_infered
from logilab.astng.protocols import _arguments_infer_argname
_CONST_PROXY = {
type(None): raw_building.build_class('NoneType'),
bool: MANAGER.astng_from_class(bool),
int: MANAGER.astng_from_class(int),
long: MANAGER.astng_from_class(long),
float: MANAGER.astng_from_class(float),
complex: MANAGER.astng_from_class(complex),
str: MANAGER.astng_from_class(str),
unicode: MANAGER.astng_from_class(unicode),
}
_CONST_PROXY[type(None)].parent = _CONST_PROXY[bool].parent
def _set_proxied(const):
if not hasattr(const, '__proxied'):
const.__proxied = _CONST_PROXY[const.value.__class__]
return const.__proxied
nodes.Const._proxied = property(_set_proxied)