This is my code in progress:

Is there any faculty for type mismatches in astroid currently? I am looking to infer a return value from a function the default way, and the return value from a function's docstring, and show a warning if the two types don't match up.

On Thu, May 22, 2014 at 12:48 AM, Sylvain Thénault <> wrote:
Hi George,

On 16 mai 11:34, George Schneeloch wrote:
> I've been working on a pylint-brain plugin to do inference based on
> docstring type information. I'd like to set the order of type inference
> such that, if there is a type already found it uses that, else it uses
> what's in the docstring. Is there a way to do this? I'd also like to avoid
> clobbering other pylint-brain plugin results if possible. Is there a
> mechanism to set priority here? Currently the plugin will override all
> other inference if types are specified in the docstring, which may be
> undesirable.

Could you provide an example of what you would like to achieve and the problem
you're encountering?

I'm afraid there are no notion of "type inference priority" mecanism, but by
better understanding of your problem one may have other idea. As a side note I
would say that it sounds good to me that inference driven by annotation (python
3 or docstring based) would then only consider those types and not those from
the "regular" inference.
Sylvain Thénault, LOGILAB, Paris ( - Toulouse (
Formations Python, Debian, Méth. Agiles:
Développement logiciel sur mesure:
CubicWeb, the semantic web framework: