f-strings are now parsed as part of the Python grammar and not in separate
steps.
Note that this is not the way that CPython does it. CPython still uses multiple
parse steps in ast.c.
The problem with this commit is that it probably makes some checks slower. It's
still slightly more beautiful, but we leave it for now.
This reverts commit 25e4ea9c24.
Change Grammar._parse() to try load_module() even if code was passed
to it.
In many cases, _parse() is passed both the code and the path to the .py
file. E.g. in jedi-vim if you type "import foo.", then every .py file in
directory "foo" will reach Grammar._parse() with both the `code` and the
`path` variables filled in. This change allows the cache to be used in
those cases.
* Add Function.iter_raise_stmts method and tests
* Add Alisdair Robertson to AUTHORS.txt
* Cleanup Function.iter_raise_stmts and test
Decided not to try and exclude exceptions that would be caught by a try-catch
Change Parso to use cPickle instead of pickle when reading/writing the
cache, which speeds up the cache significantly.
In Python 2, cPickle is up to 1000 times faster than pickle. (In Python
3, if you "import pickle", you are actually getting cPickle.)
As is the convention, the code tries to import cPickle, and if that
fails, it falls back to pickle.
This has a big impact for users of jedi-vim, since in many cases Vim
uses Python 2.
Any caller of Parso can specify a cache path, and if none is specified,
parso will fall back to a default.
Parso's code to read a file from the cache handled this correctly; but
its code to write a file to the cache had a bug -- any override of the
default was ignored.
In the case of Jedi, this is a significant problem, since Jedi overrides
the default. The result is that files will be written to the cache, but
will then never be found when reading from the cache.