本文整理汇总了Python中rope.base.pyobjects.get_unknown函数的典型用法代码示例。如果您正苦于以下问题:Python get_unknown函数的具体用法?Python get_unknown怎么用?Python get_unknown使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_unknown函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_returned_object
def get_returned_object(self, args):
result = rope.base.evaluate.get_statement_result(self.scope,
self.node.body)
if result is not None:
return result.get_object()
else:
return pyobjects.get_unknown()
示例2: _self_set
def _self_set(self, context):
if self.holding is not None:
return
iterable = context.get_pyname('iterable')
holding = _infer_sequence_for_pyname(iterable)
if holding is not None and holding != pyobjects.get_unknown():
context.save_per_name(holding)
示例3: unsure_pyname
def unsure_pyname(pyname, unbound=True):
"""Return `True` if we don't know what this name references"""
if pyname is None:
return True
if unbound and not isinstance(pyname, pynames.UnboundName):
return False
if pyname.get_object() == pyobjects.get_unknown():
return True
示例4: _Attribute
def _Attribute(self, node):
if not isinstance(node.ctx, ast.Store):
scope = self.scope.get_inner_scope_for_line(node.lineno)
pyname = evaluate.eval_node(scope, node.value)
if pyname is not None and \
pyname.get_object() != pyobjects.get_unknown():
if node.attr not in pyname.get_object():
self._add_error(node, 'Unresolved attribute')
ast.walk(node.value, self)
示例5: _object_attributes
def _object_attributes(obj, parent):
attributes = {}
for name in dir(obj):
if name == 'None':
continue
child = getattr(obj, name)
pyobject = None
if inspect.isclass(child):
pyobject = BuiltinClass(child, {}, parent=parent)
elif inspect.isroutine(child):
pyobject = BuiltinFunction(builtin=child, parent=parent)
else:
pyobject = pyobjects.get_unknown()
attributes[name] = BuiltinName(pyobject)
return attributes
示例6: _set_add
def _set_add(self, context):
if self.holding is not None:
return
holding = context.get_arguments(['self', 'value'])[1]
if holding is not None and holding != pyobjects.get_unknown():
context.save_per_name(holding)
示例7: _dict_add
def _dict_add(self, context):
if self.keys is not None:
return
key, value = context.get_arguments(['self', 'key', 'value'])[1:]
if key is not None and key != pyobjects.get_unknown():
context.save_per_name(get_tuple(key, value))
示例8: _list_add
def _list_add(self, context):
if self.holding is not None:
return
holding = context.get_argument('value')
if holding is not None and holding != pyobjects.get_unknown():
context.save_per_name(holding)
示例9: __init__
def __init__(self, builtin):
super(BuiltinUnknown, self).__init__(pyobjects.get_unknown())
self.builtin = builtin
self.type = pyobjects.get_unknown()