This is my code in progress: https://github.com/bostonbusmap/docstring-inference/blob/master/docstring_inference.py

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.
-George


On Thu, May 22, 2014 at 12:48 AM, Sylvain Thénault <sylvain.thenault@logilab.fr> 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 (01.45.32.03.12) - Toulouse (05.62.17.16.42)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org