desc
stringlengths
3
26.7k
decl
stringlengths
11
7.89k
bodies
stringlengths
8
553k
'Function description. :return Rename:'
@staticmethod def get_refactor(ctx):
return ModuleToPackage(ctx.project, ctx.resource)
'Get changes. :return Changes:'
@staticmethod def get_changes(refactor, input_str, in_hierarchy=False):
return refactor.get_changes()
'Get destination. :return str:'
@staticmethod def get_input_str(refactor, ctx):
return env.user_input('Enter destination:')
'Function description. :return Rename:'
@staticmethod def get_refactor(ctx):
(_, offset) = env.get_offset_params() if (offset == 0): offset = None return move.create_move(ctx.project, ctx.resource, offset)
'Get destination. :return str:'
@staticmethod def get_input_str(refactor, ctx):
args = refactor.get_args() default = ', '.join((a[0] for a in args)) return env.user_input('Change the signature:', default)
'Function description. :return Rename:'
@staticmethod def get_refactor(ctx):
(_, offset) = env.get_offset_params() return change_signature.ChangeSignature(ctx.project, ctx.resource, offset)
'Function description. :return Rope.changes:'
def get_changes(self, refactor, input_string, in_hierarchy=False):
args = re.sub('[\\s\\(\\)]+', '', input_string).split(',') olds = [arg[0] for arg in refactor.get_args()] changers = [] for arg in [a for a in olds if (a not in args)]: changers.append(change_signature.ArgumentRemover(olds.index(arg))) olds.remove(arg) order = [] for (index, arg)...
'Function description.'
def __init__(self, kind, *args, **kwargs):
self.kind = kind super(GenerateElementRefactoring, self).__init__(*args, **kwargs)
'Function description. :return Rename:'
def get_refactor(self, ctx):
(_, offset) = env.get_offset_params() return generate.create_generate(self.kind, ctx.project, ctx.resource, offset)
'Function description. :return Rope.changes:'
def get_changes(self, refactor, input_str, in_hierarchy=False):
return refactor.get_changes()
'Deprecated, use `source\'.'
@property def filename(self):
warnings.warn(u"The 'filename' attribute will be removed in future versions. Use 'source' instead.", DeprecationWarning, stacklevel=2) return self.source
'Deprecated, user `source\'.'
@filename.setter def filename(self, value):
warnings.warn(u"The 'filename' attribute will be removed in future versions. Use 'source' instead.", DeprecationWarning, stacklevel=2) self.source = value
'Return a list of section names, excluding [DEFAULT]'
def sections(self):
return list(self._sections.keys())
'Create a new section in the configuration. Raise DuplicateSectionError if a section by the specified name already exists. Raise ValueError if name is DEFAULT.'
def add_section(self, section):
if (section == self.default_section): raise ValueError((u'Invalid section name: %r' % section)) if (section in self._sections): raise DuplicateSectionError(section) self._sections[section] = self._dict() self._proxies[section] = SectionProxy(self, section)
'Indicate whether the named section is present in the configuration. The DEFAULT section is not acknowledged.'
def has_section(self, section):
return (section in self._sections)
'Return a list of option names for the given section name.'
def options(self, section):
try: opts = self._sections[section].copy() except KeyError: raise from_none(NoSectionError(section)) opts.update(self._defaults) return list(opts.keys())
'Read and parse a filename or a list of filenames. Files that cannot be opened are silently ignored; this is designed so that you can specify a list of potential configuration file locations (e.g. current directory, user\'s home directory, systemwide directory), and all existing configuration files in the list will be ...
def read(self, filenames, encoding=None):
if (PY2 and isinstance(filenames, bytes)): warnings.warn(u'You passed a bytestring as `filenames`. This will not work on Python 3. Use `cp.read_file()` or switch to using Unicode strings across the board.', DeprecationWarning, stacklevel=2...
'Like read() but the argument must be a file-like object. The `f\' argument must be iterable, returning one line at a time. Optional second argument is the `source\' specifying the name of the file being read. If not given, it is taken from f.name. If `f\' has no `name\' attribute, `<???>\' is used.'
def read_file(self, f, source=None):
if (source is None): try: source = f.name except AttributeError: source = u'<???>' self._read(f, source)
'Read configuration from a given string.'
def read_string(self, string, source=u'<string>'):
sfile = io.StringIO(string) self.read_file(sfile, source)
'Read configuration from a dictionary. Keys are section names, values are dictionaries with keys and values that should be present in the section. If the used dictionary type preserves order, sections and their keys will be added in order. All types held in the dictionary are converted to strings during reading, includ...
def read_dict(self, dictionary, source=u'<dict>'):
elements_added = set() for (section, keys) in dictionary.items(): section = str(section) try: self.add_section(section) except (DuplicateSectionError, ValueError): if (self._strict and (section in elements_added)): raise elements_added.add(...
'Deprecated, use read_file instead.'
def readfp(self, fp, filename=None):
warnings.warn(u"This method will be removed in future versions. Use 'parser.read_file()' instead.", DeprecationWarning, stacklevel=2) self.read_file(fp, source=filename)
'Get an option value for a given section. If `vars\' is provided, it must be a dictionary. The option is looked up in `vars\' (if provided), `section\', and in `DEFAULTSECT\' in that order. If the key is not found and `fallback\' is provided, it is used as a fallback value. `None\' can be provided as a `fallback\' valu...
def get(self, section, option, **kwargs):
raw = kwargs.get(u'raw', False) vars = kwargs.get(u'vars', None) fallback = kwargs.get(u'fallback', _UNSET) try: d = self._unify_values(section, vars) except NoSectionError: if (fallback is _UNSET): raise else: return fallback option = self.optionx...
'Return a list of (name, value) tuples for each option in a section. All % interpolations are expanded in the return values, based on the defaults passed into the constructor, unless the optional argument `raw\' is true. Additional substitutions may be provided using the `vars\' argument, which must be a dictionary wh...
def items(self, section=_UNSET, raw=False, vars=None):
if (section is _UNSET): return super(RawConfigParser, self).items() d = self._defaults.copy() try: d.update(self._sections[section]) except KeyError: if (section != self.default_section): raise NoSectionError(section) if vars: for (key, value) in vars.item...
'Remove a section from the parser and return it as a (section_name, section_proxy) tuple. If no section is present, raise KeyError. The section DEFAULT is never returned because it cannot be removed.'
def popitem(self):
for key in self.sections(): value = self[key] del self[key] return (key, value) raise KeyError
'Check for the existence of a given option in a given section. If the specified `section\' is None or an empty string, DEFAULT is assumed. If the specified `section\' does not exist, returns False.'
def has_option(self, section, option):
if ((not section) or (section == self.default_section)): option = self.optionxform(option) return (option in self._defaults) elif (section not in self._sections): return False else: option = self.optionxform(option) return ((option in self._sections[section]) or (opti...
'Set an option.'
def set(self, section, option, value=None):
if value: value = self._interpolation.before_set(self, section, option, value) if ((not section) or (section == self.default_section)): sectdict = self._defaults else: try: sectdict = self._sections[section] except KeyError: raise from_none(NoSectionEr...
'Write an .ini-format representation of the configuration state. If `space_around_delimiters\' is True (the default), delimiters between keys and values are surrounded by spaces.'
def write(self, fp, space_around_delimiters=True):
if space_around_delimiters: d = u' {0} '.format(self._delimiters[0]) else: d = self._delimiters[0] if self._defaults: self._write_section(fp, self.default_section, self._defaults.items(), d) for section in self._sections: self._write_section(fp, section, self._secti...
'Write a single section to the specified `fp\'.'
def _write_section(self, fp, section_name, section_items, delimiter):
fp.write(u'[{0}]\n'.format(section_name)) for (key, value) in section_items: value = self._interpolation.before_write(self, section_name, key, value) if ((value is not None) or (not self._allow_no_value)): value = (delimiter + str(value).replace(u'\n', u'\n DCTB ')) else: ...
'Remove an option.'
def remove_option(self, section, option):
if ((not section) or (section == self.default_section)): sectdict = self._defaults else: try: sectdict = self._sections[section] except KeyError: raise from_none(NoSectionError(section)) option = self.optionxform(option) existed = (option in sectdict) ...
'Remove a file section.'
def remove_section(self, section):
existed = (section in self._sections) if existed: del self._sections[section] del self._proxies[section] return existed
'Parse a sectioned configuration file. Each section in a configuration file contains a header, indicated by a name in square brackets (`[]\'), plus key/value options, indicated by `name\' and `value\' delimited with a specific substring (`=\' or `:\' by default). Values can span multiple lines, as long as they are inde...
def _read(self, fp, fpname):
elements_added = set() cursect = None sectname = None optname = None lineno = 0 indent_level = 0 e = None for (lineno, line) in enumerate(fp, start=1): comment_start = sys.maxsize inline_prefixes = dict(((p, (-1)) for p in self._inline_comment_prefixes)) while ((c...
'Create a sequence of lookups with \'vars\' taking priority over the \'section\' which takes priority over the DEFAULTSECT.'
def _unify_values(self, section, vars):
sectiondict = {} try: sectiondict = self._sections[section] except KeyError: if (section != self.default_section): raise NoSectionError(section) vardict = {} if vars: for (key, value) in vars.items(): if (value is not None): value = str...
'Return a boolean value translating from other types if necessary.'
def _convert_to_boolean(self, value):
if (value.lower() not in self.BOOLEAN_STATES): raise ValueError((u'Not a boolean: %s' % value)) return self.BOOLEAN_STATES[value.lower()]
'Raises a TypeError for non-string values. The only legal non-string value if we allow valueless options is None, so we need to check if the value is a string if: - we do not allow valueless options, or - we allow valueless options but the value is not None For compatibility reasons this method is not used in classic s...
def _validate_value_types(self, **kwargs):
section = kwargs.get(u'section', u'') option = kwargs.get(u'option', u'') value = kwargs.get(u'value', u'') if (PY2 and (bytes in (type(section), type(option), type(value)))): warnings.warn(u'You passed a bytestring. Implicitly decoding as UTF-8 string. This will ...
'Set an option. Extends RawConfigParser.set by validating type and interpolation syntax on the value.'
def set(self, section, option, value=None):
(_, option, value) = self._validate_value_types(option=option, value=value) super(ConfigParser, self).set(section, option, value)
'Create a new section in the configuration. Extends RawConfigParser.add_section by validating if the section name is a string.'
def add_section(self, section):
(section, _, _) = self._validate_value_types(section=section) super(ConfigParser, self).add_section(section)
'Creates a view on a section of the specified `name` in `parser`.'
def __init__(self, parser, name):
self._parser = parser self._name = name for conv in parser.converters: key = (u'get' + conv) getter = functools.partial(self.get, _impl=getattr(parser, key)) setattr(self, key, getter)
'Get an option value. Unless `fallback` is provided, `None` will be returned if the option is not found.'
def get(self, option, fallback=None, **kwargs):
kwargs.setdefault(u'raw', False) kwargs.setdefault(u'vars', None) _impl = kwargs.pop(u'_impl', None) if (not _impl): _impl = self._parser.get return _impl(self._name, option, fallback=fallback, **kwargs)
'Initialize a ChainMap by setting *maps* to the given mappings. If no mappings are provided, a single empty dictionary is used.'
def __init__(self, *maps):
self.maps = (list(maps) or [{}])
'Create a ChainMap with a single dict created from the iterable.'
@classmethod def fromkeys(cls, iterable, *args):
return cls(dict.fromkeys(iterable, *args))
'New ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]'
def copy(self):
return self.__class__(self.maps[0].copy(), *self.maps[1:])
'New ChainMap with a new dict followed by all previous maps.'
def new_child(self):
return self.__class__({}, *self.maps)
'New ChainMap from maps[1:].'
@property def parents(self):
return self.__class__(*self.maps[1:])
'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.'
def popitem(self):
try: return self.maps[0].popitem() except KeyError: raise KeyError(u'No keys found in the first mapping.')
'Remove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].'
def pop(self, key, *args):
try: return self.maps[0].pop(key, *args) except KeyError: raise KeyError(u'Key not found in the first mapping: {!r}'.format(key))
'Clear maps[0], leaving maps[1:] intact.'
def clear(self):
self.maps[0].clear()
'Return true, if the named module is a package. We need this method to get correct spec objects with Python 3.4 (see PEP451)'
def is_package(self, fullname):
return hasattr(self.__get_module(fullname), '__path__')
'Return None Required, if is_package is implemented'
def get_code(self, fullname):
self.__get_module(fullname) return None
'Build an astroid from a living module instance.'
def module_build(self, module, modname=None):
node = None path = getattr(module, '__file__', None) if (path is not None): (path_, ext) = os.path.splitext(modutils._path_from_filename(path)) if ((ext in ('.py', '.pyc', '.pyo')) and os.path.exists((path_ + '.py'))): node = self.file_build((path_ + '.py'), modname) if (node...
'Build astroid from a source code file (i.e. from an ast) *path* is expected to be a python source file'
def file_build(self, path, modname=None):
try: (stream, encoding, data) = open_source_file(path) except IOError as exc: util.reraise(exceptions.AstroidBuildingError('Unable to load file {path}:\n{error}', modname=modname, path=path, error=exc)) except (SyntaxError, LookupError) as exc: util.reraise(exceptions.Ast...
'Build astroid from source code string.'
def string_build(self, data, modname='', path=None):
module = self._data_build(data, modname, path) module.file_bytes = data.encode('utf-8') return self._post_build(module, 'utf-8')
'Handles encoding and delayed nodes after a module has been built'
def _post_build(self, module, encoding):
module.file_encoding = encoding self._manager.cache_module(module) for from_node in module._import_from_nodes: if (from_node.modname == '__future__'): for (symbol, _) in from_node.names: module.future_imports.add(symbol) self.add_from_names_to_locals(from_node) ...
'Build tree node from data and add some informations'
def _data_build(self, data, modname, path):
try: node = _parse((data + '\n')) except (TypeError, ValueError, SyntaxError) as exc: util.reraise(exceptions.AstroidSyntaxError('Parsing Python code failed:\n{error}', source=data, modname=modname, path=path, error=exc)) if (path is not None): node_file = os.path.abspath(pa...
'Store imported names to the locals Resort the locals if coming from a delayed node'
def add_from_names_to_locals(self, node):
_key_func = (lambda node: node.fromlineno) def sort_locals(my_list): my_list.sort(key=_key_func) for (name, asname) in node.names: if (name == '*'): try: imported = node.do_import_module() except exceptions.AstroidBuildingError: continu...
'Visit a AssAttr node This adds name to locals and handle members definition.'
def delayed_assattr(self, node):
try: frame = node.frame() for inferred in node.expr.infer(): if (inferred is util.Uninferable): continue try: if (inferred.__class__ is bases.Instance): inferred = inferred._proxied iattrs = inferred.inst...
'return the \'qualified\' name of the node, eg module.name, module.class.name ...'
def qname(self):
if (self.parent is None): return self.name return ('%s.%s' % (self.parent.frame().qname(), self.name))
'return the first parent frame node (i.e. Module, FunctionDef or ClassDef)'
def frame(self):
return self
'return the first node defining a new scope (i.e. Module, FunctionDef, ClassDef, Lambda but also GeneratorExp, DictComp and SetComp)'
def scope(self):
return self
'XXX method for interfacing the scope lookup'
def _scope_lookup(self, node, name, offset=0):
try: stmts = node._filter_stmts(self.locals[name], self, offset) except KeyError: stmts = () if stmts: return (self, stmts) if self.parent: pscope = self.parent.scope() if (not pscope.is_function): pscope = pscope.root() return pscope.scope_loo...
'define <name> in locals (<stmt> is the node defining the name) if the node is a Module node (i.e. has globals), add the name to globals if the name is already defined, ignore it'
def set_local(self, name, stmt):
self.locals.setdefault(name, []).append(stmt)
'append a child, linking it in the tree'
def _append_node(self, child):
self.body.append(child) child.parent = self
'append a child which should alter locals to the given node'
def add_local_node(self, child_node, name=None):
if (name != '__class__'): self._append_node(child_node) self.set_local((name or child_node.name), child_node)
'method from the `dict` interface returning the first node associated with the given name in the locals dictionary :type item: str :param item: the name of the locally defined object :raises KeyError: if the name is not defined'
def __getitem__(self, item):
return self.locals[item][0]
'method from the `dict` interface returning an iterator on `self.keys()`'
def __iter__(self):
return iter(self.keys())
'method from the `dict` interface returning a tuple containing locally defined names'
def keys(self):
return list(self.locals.keys())
'method from the `dict` interface returning a tuple containing locally defined nodes which are instance of `FunctionDef` or `ClassDef`'
def values(self):
return [self[key] for key in self.keys()]
'method from the `dict` interface returning a list of tuple containing each locally defined name with its associated node, which is an instance of `FunctionDef` or `ClassDef`'
def items(self):
return list(zip(self.keys(), self.values()))
'Get a stream to the underlying file or bytes.'
def stream(self):
return self._get_stream()
'Close the underlying file streams.'
def close(self):
warnings.warn("close method is deprecated and it is slated for removal in astroid 1.6, along with 'file_stream' property. Its behaviour is replaced by managing each file stream returned by the 'stream' method.", PendingDepreca...
'return block line numbers. start from the beginning whatever the given lineno'
def block_range(self, lineno):
return (self.fromlineno, self.tolineno)
'inferred getattr'
def igetattr(self, name, context=None):
context = contextmod.copy_context(context) context.lookupname = name try: return bases._infer_stmts(self.getattr(name, context), context, frame=self) except exceptions.AttributeInferenceError as error: util.reraise(exceptions.InferenceError(error.message, target=self, attribute=name, con...
'return True if this module has been built from a .py file and so contains a complete representation including the code'
def fully_defined(self):
return ((self.file is not None) and self.file.endswith('.py'))
'return the first parent node marked as statement node consider a module as a statement...'
def statement(self):
return self
'module has no sibling'
def previous_sibling(self):
return
'module has no sibling'
def next_sibling(self):
return
'import the given module considering self as context'
def import_module(self, modname, relative_only=False, level=None):
if (relative_only and (level is None)): level = 0 absmodname = self.relative_to_absolute_name(modname, level) try: return MANAGER.ast_from_module_name(absmodname) except exceptions.AstroidBuildingError: if relative_only: raise return MANAGER.ast_from_module_name(m...
'return the absolute module name for a relative import. The relative import can be implicit or explicit.'
def relative_to_absolute_name(self, modname, level):
if (self.absolute_import_activated() and (level is None)): return modname if level: if self.package: level = (level - 1) if (level and (self.name.count('.') < level)): raise exceptions.TooManyLevelsError(level=level, name=self.name) package_name = self.nam...
'return the list of imported names when this module is \'wildcard imported\' It doesn\'t include the \'__builtins__\' name which is added by the current CPython implementation of wildcard imports.'
def wildcard_import_names(self):
default = [name for name in self.keys() if (not name.startswith('_'))] try: all_values = self['__all__'] except KeyError: return default try: explicit = next(all_values.assigned_stmts()) except exceptions.InferenceError: return default except AttributeError: ...
'Get the list of the names which are publicly available in this module.'
def public_names(self):
return [name for name in self.keys() if (not name.startswith('_'))]
'return a list of argument names'
def argnames(self):
if self.args.args: names = _rec_get_names(self.args.args) else: names = [] if self.args.vararg: names.append(self.args.vararg) if self.args.kwarg: names.append(self.args.kwarg) return names
'infer what a function is returning when called'
def infer_call_result(self, caller, context=None):
return self.body.infer(context)
'Get the extra decorators that this function can haves Additional decorators are considered when they are used as assignments, as in `method = staticmethod(method)`. The property will return all the callables that are used for decoration.'
@decorators_mod.cachedproperty def extra_decorators(self):
frame = self.parent.frame() if (not isinstance(frame, ClassDef)): return [] decorators = [] for assign in frame.nodes_of_class(node_classes.Assign): if (isinstance(assign.value, node_classes.Call) and isinstance(assign.value.func, node_classes.Name)): for assign_node in assig...
'Get the function type for this node. Possible values are: method, function, staticmethod, classmethod.'
@decorators_mod.cachedproperty def type(self):
builtin_descriptors = {'classmethod', 'staticmethod'} for decorator in self.extra_decorators: if (decorator.func.name in builtin_descriptors): return decorator.func.name frame = self.parent.frame() type_name = 'function' if isinstance(frame, ClassDef): if (self.name == '_...
'return block line numbers. start from the "def" position whatever the given lineno'
def block_range(self, lineno):
return (self.fromlineno, self.tolineno)
'this method doesn\'t look in the instance_attrs dictionary since it\'s done by an Instance proxy at inference time.'
def getattr(self, name, context=None):
if (name in self.instance_attrs): return self.instance_attrs[name] if (name in self.special_attributes): return [self.special_attributes.lookup(name)] raise exceptions.AttributeInferenceError(target=self, attribute=name)
'Inferred getattr, which returns an iterator of inferred statements.'
def igetattr(self, name, context=None):
try: return bases._infer_stmts(self.getattr(name, context), context, frame=self) except exceptions.AttributeInferenceError as error: util.reraise(exceptions.InferenceError(error.message, target=self, attribute=name, context=context))
'return true if the function node should be considered as a method'
def is_method(self):
return ((self.type != 'function') and isinstance(self.parent.frame(), ClassDef))
'return a list of decorator qualified names'
@decorators_mod.cached def decoratornames(self):
result = set() decoratornodes = [] if (self.decorators is not None): decoratornodes += self.decorators.nodes decoratornodes += self.extra_decorators for decnode in decoratornodes: try: for infnode in decnode.infer(): result.add(infnode.qname()) exc...
'return true if the function is bound to an Instance or a class'
def is_bound(self):
return (self.type == 'classmethod')
'Returns True if the method is abstract. A method is considered abstract if - the only statement is \'raise NotImplementedError\', or - the only statement is \'pass\' and pass_is_abstract is True, or - the method is annotated with abc.astractproperty/abc.abstractmethod'
def is_abstract(self, pass_is_abstract=True):
if self.decorators: for node in self.decorators.nodes: try: inferred = next(node.infer()) except exceptions.InferenceError: continue if (inferred and (inferred.qname() in ('abc.abstractproperty', 'abc.abstractmethod'))): ret...
'return true if this is a generator function'
def is_generator(self):
yield_nodes = (node_classes.Yield, node_classes.YieldFrom) return next(self.nodes_of_class(yield_nodes, skip_klass=(FunctionDef, Lambda)), False)
'infer what a function is returning when called'
def infer_call_result(self, caller, context=None):
if self.is_generator(): result = bases.Generator(self) (yield result) return if ((self.name == 'with_metaclass') and (len(self.args.args) == 1) and (self.args.vararg is not None)): metaclass = next(caller.args[0].infer(context)) if isinstance(metaclass, ClassDef): ...
'return block line numbers. start from the "class" position whatever the given lineno'
def block_range(self, lineno):
return (self.fromlineno, self.tolineno)
'infer what a class is returning when called'
def infer_call_result(self, caller, context=None):
if (self.is_subtype_of(('%s.type' % (BUILTINS,)), context) and (len(caller.args) == 3)): result = self._infer_type_call(caller, context) (yield result) else: (yield bases.Instance(self))
'Get the list of parent class names, as they appear in the class definition.'
@property def basenames(self):
return [bnode.as_string() for bnode in self.bases]
'return an iterator on the node base classes in a prefixed depth first order :param recurs: boolean indicating if it should recurse or return direct ancestors only'
def ancestors(self, recurs=True, context=None):
yielded = set([self]) if (context is None): context = contextmod.InferenceContext() if six.PY3: if ((not self.bases) and (self.qname() != 'builtins.object')): (yield builtin_lookup('object')[1][0]) return for stmt in self.bases: with context.restore_path()...
'return an iterator on astroid representation of parent classes which have <name> defined in their locals'
def local_attr_ancestors(self, name, context=None):
if (self.newstyle and all((n.newstyle for n in self.ancestors(context)))): try: ancestors = self.mro(context)[1:] except exceptions.MroError: ancestors = self.ancestors(context=context) else: ancestors = self.ancestors(context=context) for astroid in ancestors...
'return an iterator on astroid representation of parent classes which have <name> defined in their instance attribute dictionary'
def instance_attr_ancestors(self, name, context=None):
for astroid in self.ancestors(context=context): if (name in astroid.instance_attrs): (yield astroid)
'return the list of assign node associated to name in this class locals or in its parents :raises `AttributeInferenceError`: if no attribute with this name has been find in this class or its parent classes'
def local_attr(self, name, context=None):
result = [] if (name in self.locals): result = self.locals[name] else: class_node = next(self.local_attr_ancestors(name, context), ()) if class_node: result = class_node.locals[name] result = [n for n in result if (not isinstance(n, node_classes.DelAttr))] if resu...
'return the astroid nodes associated to name in this class instance attributes dictionary and in its parents :raises `AttributeInferenceError`: if no attribute with this name has been find in this class or its parent classes'
def instance_attr(self, name, context=None):
values = list(self.instance_attrs.get(name, [])) for class_node in self.instance_attr_ancestors(name, context): values += class_node.instance_attrs[name] values = [n for n in values if (not isinstance(n, node_classes.DelAttr))] if values: return values raise exceptions.AttributeInfer...