| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
|
| |
|
|
| |
This removes the old coverage feature.
|
| | |
|
| | |
|
| |
|
|
| |
DictInstance.
|
| |
|
|
|
|
| |
For instance, a module can decide to redefine its __file__ attribute.
Previously, this was defaulting to the file name itself, without taking
in account local redefinitions.
|
| |
|
|
|
|
|
|
|
|
| |
special_attributes
The introduction of the special attribute models led to an interesting bug, where
some of the members of the builtin type were not added into it, since they were
already defined at the level of the special_attributes. The latter is just a declaration
of what attributes a type can have, usually leading to introspecting the type itself for
retrieving the value of the special attribute.
|
| |
|
|
| |
type.mro, respectively type.__subclasses__.
|
| |
|
|
|
|
|
|
| |
hierarchy can't be determined
It used to return Uninferable, but no call site was actually taking care of this
potential return. It is better though to simply raise an exception and to let
the call sites to handle them in which way they want to.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
receiving symlinks and whatnot.
Close PyCQA/pylint#791
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
imports.
|
| | |
|
| | |
|
| |
|
|
| |
multiple directories contributing to the same namespace.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
implemented.
|
| |
|
|
| |
and add a test for implicit namespace packages.
|
| | |
|
| | |
|
| |
|
|
| |
which is a builtin object (a property)
|
| |
|
|
|
|
|
|
| |
The inference can handle the case where the attribute is accessed through a subclass
of a base class and the attribute is defined at the base class's level,
by taking in consideration a redefinition in the subclass.
This should fix https://github.com/PyCQA/pylint/issues/432
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
not be applied.
|
| |
|
|
|
|
| |
declaration forbids them.
Close issue #332
|
| | |
|
| |
|
|
|
|
| |
This can be used for understanding highly dynamic code, which involves
modifications of attributes at runtime (updating globals for example,
where the elements come from a dir(something))
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes a problem with the transforms on Python 2, which were never called due
to a bad interaction between a transform and the underlying inference mechanism.
The string / byte class was patched before the brain modules were loaded, since
extend_str was called at the module level. Inside extend_str we were using .locals,
which triggers .delayed_assignments, which can trigger as well inference. In the case
of Python 2, this led to importing of the six module before actually having the transforms
ready for it, which means that no transforming was ever done for some of these modules.
By delaying the patching of the builtins module until builtins is ready, we alleviate
this problem.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
we're building
They can be different when in the original module (let's say an __init__ file) the object
is imported under a name and then used as a base class for a class with the same name as
the object in question, paired with the fact that the initial object is faking its name
inside is original module. This happens for instance with the bitarray module, which has
a bitarray._bitarray C extensions, which defines a bitarray._bitarray._bitarray type,
the latter faking its name as bitarray._bitarray. In the __init__ file, the original
type gets used as a base class in the actual bitarray class that the module exports.
What happens is that this behaviour will introduce a cycle in the form of an ImportFrom
as in 'from bitarray._bitarray import _bitarray as _bitarray` when analyzing the bitarray._bitarray
module, which means that the resulting ast will reimport itself, leading to not inferring
anything from the module. The solution we're using is to check that the module where we expected
to have our object actually has the object we want.
Unfortunately I couldn't find a Python test through which we can reflect this behaviour
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
Some of exceptions's attributes, such as .args and .message,
can't be inferred correctly since they are descriptors that get
transformed into the proper objects at runtime. This can cause issues
with the static analysis, since they are inferred as different than
what's expected. Now when we're creating instances of exceptions,
we're inferring a special object that knows how to transform those
runtime attributes into the proper objects via a custom object model.
Closes #81
|
| | |
|
| |
|
|
|
| |
They were previously tied because UnboundMethod had logic for type.__new__. Now this logic
was moved into a brain tip, simplifying the implementations of the methods.
|
| |
|
|
|
|
|
| |
Instead, we're inferring FunctionDefs where an unbound access
to a method was found.
Close #257
|
| |\
| |
| | |
Introduce a special attributes model
|
| |/
|
|
|
|
|
|
| |
Through this model, astroid starts knowing special attributes of certain Python objects,
such as functions, classes, super objects and so on. This was previously possible before,
but now the lookup and the attributes themselves are separated into a new module,
objectmodel.py, which describes, in a more comprehensive way, the data model of each
object.
|
| | |
|