1
0
forked from VimPlug/jedi
Commit Graph

228 Commits

Author SHA1 Message Date
Peter Law 599a1c3ee1 Handle generics appearing within quoted return annotations
This ensures that these quoted likely forwards references in
return type annotations behave like their non-quoted equivalents.

I suspect there may be other places which will need similar
adjustments, which may mean that we should push the conversion
a layer closer to the parsing (perhaps in `py__annotations__`?).

One case I know that this doesn't solve (but which likely needs
similar adjustment) is generics in return types of comment-style
annotations. They're less likely and may not be worth supporting
since all supported Python versions can use the in-syntax spelling
for annotations at this point.
2021-07-25 15:32:22 +01:00
Peter Law 6814a7336c Hoist common variable for additional re-use 2021-07-25 15:23:51 +01:00
Peter Law 25a3e31ca8 Add a __repr__ 2021-07-24 17:12:34 +01:00
Dave Halter 7555dc0d45 Get rid of cast_path 2021-01-14 01:39:51 +01:00
Dave Halter 36ea6b3285 Change an import 2021-01-01 05:19:37 +01:00
Dave Halter 85f45771f1 Fix typing.NewType signature 2021-01-01 04:22:52 +01:00
Dave Halter 30e702de11 Generics don't have signatures 2021-01-01 04:09:49 +01:00
Dave Halter 778442a972 Type aliases should not have a signature 2021-01-01 03:59:28 +01:00
Dave Halter 4f34712858 Fix signatures for TypeVar and cast, fixes #1709 2021-01-01 03:59:12 +01:00
Dave Halter 92d96ac336 actually use auto_import_modules correctly 2021-01-01 02:59:42 +01:00
Dave Halter a03a093e2c change the create_stub_module stuff a bit 2020-10-24 10:41:59 +02:00
Peter Law b892c07841 Merge branch 'master' into mypy 2020-07-26 12:25:19 +01:00
Peter Law 45c90efb5c Remove a couple of unused imports 2020-07-26 12:17:54 +01:00
Dave Halter 9d1587a41d Don't need to inherit from object anymore 2020-07-26 00:11:57 +02:00
Peter Law 1418aada91 Annotate top level items mypy needs annotating 2020-07-24 16:10:34 +01:00
Peter Law 9505dabfef Reflow for linting 2020-07-21 21:32:22 +01:00
Dave Halter 9957565b37 Try to use yield from instead of yield, if possible 2020-07-19 13:34:58 +02:00
Dave Halter 480a464179 Implement all remaining Path issues and use it instead of strings 2020-07-12 01:14:00 +02:00
Dave Halter db0e90763b Start using pathlib.Path instead of all the os.path functions 2020-07-10 17:30:36 +02:00
Dave Halter dac1fb0a06 Get rid of a few Python 2 things 2020-07-02 16:00:26 +02:00
Dave Halter a0de93a638 Remove super arguments 2020-07-02 10:59:59 +02:00
Dave Halter 5ab351dc8f Remove unicode literals from code base 2020-07-02 10:43:14 +02:00
Dave Halter 7f67324210 Remove a lot more Python 2 mentions and todos 2020-07-02 10:30:58 +02:00
Dave Halter 46154a3ee7 Remove an unnecessary print 2020-07-02 03:35:24 +02:00
Dave Halter 8ee0c8593e Remove unicode usages 2020-07-02 03:26:22 +02:00
Dave Halter 6e4dfda727 Fix a minor issue 2020-07-02 03:08:07 +02:00
Dave Halter 6e184bca97 Remove most version_info.major usages 2020-07-02 03:00:01 +02:00
Dave Halter 17343bb57c Remove some more Python 3.5 references 2020-07-02 02:18:16 +02:00
Dave Halter 49e4b1a0f8 Remove force_unicode 2020-07-02 01:47:21 +02:00
Dave Halter e6a748b1a7 Fix some directory issues 2020-07-02 01:17:35 +02:00
Dave Halter 227cf00638 Remove the __builtin__ compatibility 2020-07-02 01:15:29 +02:00
Dave Halter f9a35ae42a Remove FileNotFoundError compatibility 2020-07-02 01:05:13 +02:00
Dave Halter 4e2ca9e5fd Remove some pickle compatibility 2020-07-02 00:50:58 +02:00
Dave Halter 395f7fc59e Remove inspect.Parameter compatibility 2020-07-02 00:44:25 +02:00
Dave Halter 59ccd2da93 Make partial use the __doc__ of its function, fixes #1621 2020-06-27 02:18:31 +02:00
Dave Halter 737c1e5792 Merge pull request #1614 from PeterJCLaw/fix-decorator-factory-passthrough
Support passing values through decorators from factories
2020-06-26 13:29:58 +02:00
Peter Law f72adf0cbc Switch to much simpler solution for preserving unbound type vars
Co-Authored-By: Dave Halter <davidhalter88@gmail.com>
2020-06-26 11:23:35 +01:00
Peter Law 5184d0cb9c Support passing values through decorators from factories
This builds on the approach taken in https://github.com/davidhalter/jedi/pull/1613
but applies it to type vars themselves so that their type var
nature is preserved when a function returns Callable[[T], T] and
the T has an upper bound.
2020-06-26 11:22:19 +01:00
Dave Halter eabddb9698 Remove a print 2020-06-24 01:29:50 +02:00
Dave Halter 6fcdc44f3e Typeshed third party libraries should not be loaded if they don't actually exist in the environment, fixes #1620 2020-06-24 01:08:04 +02:00
Dave Halter a3410f124a Make sure that Callables are properly represented
See also comment of https://github.com/davidhalter/jedi/pull/1614#issuecomment-647054740
2020-06-21 01:31:58 +02:00
Dave Halter 364d33119c Merge branch 'django' 2020-06-14 22:24:31 +02:00
Dave Halter 4ab35cac7b Merge branch 'master' of github.com:davidhalter/jedi 2020-06-14 18:11:50 +02:00
Dave Halter 21f1df18b6 Fix some issues with sub class matching, fixes #1560 2020-06-14 18:10:00 +02:00
Peter Law 7e637c5e5e Python 2 compatible super() 2020-06-14 16:27:39 +01:00
Peter Law 1f082b69d2 Handle passing functions and classes through a TypeVar
This fixes #1425 and #1607 by persisting the original underlying
function or class when we process a TypeVar they are passed into.
2020-06-13 23:28:20 +01:00
Dave Halter df7dd026d2 Make it possible to use inheritance on generics without always specifying type vars, see also discussion in #1593 2020-06-10 09:54:32 +02:00
Dave Halter a2108de2c0 Use py__get__ for Django Model.objects
This includes the fix in https://github.com/typeddjango/django-stubs/pull/394
2020-06-09 23:26:43 +02:00
Dave Halter cd6113c2c3 Move with_generics and define_generics to ClassMixin 2020-06-08 00:11:45 +02:00
Dave Halter 574b790296 Make it possible to use inheritance on generics without always specifying type vars, see also discussion in #1593 2020-06-06 01:23:14 +02:00