Depth-first-search for every callable, [property] descriptor, operator, __getitem__
On Fri, Sep 25, 2020 at 4:36 PM Wes Turner <wes.tur...@gmail.com> wrote: > > LSP servers and clients: https://langserver.org/ > - https://github.com/microsoft/python-language-server > - > https://code.visualstudio.com/api/language-extensions/programmatic-language-features > What static and/or dynamic analysis tools can find all handled and unhandled exceptions in every transitive {callable, [property] descriptor, operator, __getitem__} given a callable? def find_all_exceptions(callable): """ Args: callable (callable): callable to traverse from in search of handled and unhandled exceptions Returns: list: nested lists of items [exception, [exception_locations], [exception_handler_locations]] (?) """ What subset of these exceptions would a code annotation and/or docstring happen to helpfully contain? - AFAIU, there's not yet anything in any LSP Language Extensions for > statically or dynamically discovering exceptions from the DFS of all > references to types and callables of a callable > > (Type) Annotation type inference tools: > > pytype (Google) [1], PyAnnotate (Dropbox) [2], and MonkeyType (Instagram) >> [3] all do dynamic / runtime PEP-484 type annotation type inference [4] >> [1] https://github.com/google/pytype >> [2] https://github.com/dropbox/pyannotate >> [3] https://github.com/Instagram/MonkeyType >> [4] https://news.ycombinator.com/item?id=19454411 > > I haven't realized that I had need for a tool that does this either; but I guess I've effectively just manually searched for `raise` and `except` (and failed to sufficiently fuzz with every possible combination of user-supplied inputs)
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/GG7C246C2YGOBI4OMWBGO7DZYC5H7IYN/ Code of Conduct: http://python.org/psf/codeofconduct/