Commit Graph
100 Commits
Author SHA1 Message Date
Dave Halter 5acbb06315 Refactor so typing uses BaseTypingValueWithGenerics
This makes it finally possible to use type vars with Callable and some other classes.
Fixes #1413
2019-12-08 23:50:57 +01:00
Dave Halter 7319f8bf2c Make some more classes private for inference.gradual.base 2019-12-08 23:15:31 +01:00
Dave Halter d9ddaa31ae Use _create_instance_with_generics 2019-12-08 23:09:55 +01:00
Dave Halter 5874b0bd69 The generics manager is now part of DefineGenericBase 2019-12-08 23:03:15 +01:00
Dave Halter 9eef771ec5 Remove get_index_and_execute and use something else 2019-12-08 22:55:52 +01:00
Dave Halter 9e6c53151b _InstanceWrapper to _GenericInstanceWrapper 2019-12-08 22:47:07 +01:00
Dave Halter 84d10657a3 Another rename for readability 2019-12-08 22:46:35 +01:00
Dave Halter 5c4b3da45d Merge GenericClass and _AbstractAnnotatedClass 2019-12-08 22:45:30 +01:00
Dave Halter ad92882c48 Use the generics manager for all the typing classes 2019-12-08 22:42:01 +01:00
Dave Halter 8213d183fb Start using generic managers, for #1413 2019-12-08 21:56:30 +01:00
Dave Halter 4fca7bd22d Start working on generic managers, see #1413 2019-12-08 20:35:00 +01:00
Dave Halter c112858a1c Move iter_over_arguments to a separate file 2019-12-08 20:14:15 +01:00
Dave Halter deaa7265dd value_of_index -> context_of_index 2019-12-08 20:09:53 +01:00
Dave Halter 72fc85f4c3 Try to prepare DefineGenericBase for a more general usage 2019-12-08 19:58:00 +01:00
Dave Halter df697cfb03 Make AbstractAnnotatedClass private 2019-12-08 19:00:26 +01:00
Dave Halter fd054d1add Move parts of AbstractAnnotatedClass to the new class DefineGenericBase 2019-12-08 18:58:28 +01:00
Dave Halter 95763f0bb0 Formatting 2019-12-08 18:23:55 +01:00
Dave Halter aab0002950 Rename two classes to make some things clearer 2019-12-07 15:32:59 +01:00
Dave Halter ddbb87fd1d Make some lines shorter 2019-12-07 15:29:56 +01:00
Dave Halter bc99fbdfea Remove an unused InstanceArguments 2019-12-07 15:27:26 +01:00
Dave Halter 48ac0c9421 Move more stuff from gradual/typing.py to gradual/base.py 2019-12-07 15:27:14 +01:00
Dave Halter 37a9d1536c Remove TypingName, it looks like it's not used 2019-12-07 15:12:27 +01:00
Dave Halter 3dbe5c10ae Start splitting up gradual/typing.py 2019-12-07 15:11:50 +01:00
Dave Halter ab8f0ba834 Make sure Callable TypeVars are better identified, solves a part of #1413 2019-12-07 15:02:41 +01:00
Dave Halter 4bd7c2e627 Remove a TODO that was implemented 2019-12-07 14:56:20 +01:00
Dave Halter 1f73c65dcd Pin colorama to a version that works for Python 3.4 2019-12-07 01:09:36 +01:00
Dave Halter 6f70e759a4 Remove Python 3.4 test from appveyor
3.4 is end-of-life anyway so it doesn't really matter. It's also still tested
to a certain degree on travis and with the test environments. So this change
doesn't really mean much except a lower maintenance burden.
2019-12-07 01:02:18 +01:00
Dave Halter 0474371f23 Make sure overload signatures work, see #1417 2019-12-07 00:30:37 +01:00
Dave Halter c582545628 Shorten a line to < 100 chars 2019-12-06 16:41:47 +01:00
Dave Halter 759808e8bb Fix a tuple test 2019-12-05 20:01:27 +01:00
Dave Halter 36b800f8d3 Make sure that Tuple autocompletes properly, fixes #1389 2019-12-05 18:55:33 +01:00
Dave Halter 7e64bfa075 Avoid more Python 2 2019-12-05 17:44:47 +01:00
Dave Halter 54f4bd0bad Fix issues with interpreter completions on unittest.mock.
For 3.6+ an error was ignored that lead to crashes. In 3.5 the OOM killer
eventually arrived...

Fixes #1415
2019-12-05 10:09:22 +01:00
Dave Halter cf65ecdb96 Start writing the changelog 2019-12-05 01:13:52 +01:00
Dave Halter 700bd12122 Improve call signature detection by a lot
Fixes #1399
2019-12-04 23:55:26 +01:00
Dave Halter 4ba3dc69b3 Make sure we use the right context in case of goto with decorators, fixes #1427 2019-12-04 00:25:43 +01:00
Dave Halter b8a1f6da55 Python 2 still sucks. 2019-12-03 23:41:33 +01:00
Dave Halter 19aa50bb7f Make sure an assert no longer causes unnecessary trouble
Fixes #1426, fixes #1414
2019-12-03 23:10:24 +01:00
Dave Halter 8aee1e6213 Make sure that decorator signature completion is working, see #1433 2019-12-03 22:20:38 +01:00
Dave Halter f46f00bc71 Avoid wrong random call signature completion, fixes #1433 2019-12-03 22:12:33 +01:00
Dave Halter fea80c7fc8 Make sure py__iter__ has the right signature 2019-12-03 17:18:55 +01:00
Dave Halter 87852c1295 Remove probably dead code 2019-12-03 17:16:38 +01:00
Dave Halter 3d784c748e Python 2 2019-12-03 16:53:07 +01:00
Dave Halter e5d1091e80 Make sure execute_function_slots and get_function_slots is defined for all instances 2019-12-03 16:50:34 +01:00
Dave Halter 7254bec92c Upgrade typeshed to the latest commits
Also fixes some small Jedi issues with it (None interpretation in annoations mostly)
2019-12-02 10:14:59 +01:00
Dave Halter 74de9e7d53 Make sure that the differences are calculated a bit more reliable, fixes #1429 2019-12-02 00:22:15 +01:00
Dave Halter f54291a30b Unfortunately commited something that should not have been committed 2019-12-02 00:11:29 +01:00
Dave Halter 4d3f6fa790 Fix Python 2 issues 2019-12-02 00:04:22 +01:00
Dave Halter b8dfbc5d18 A CompiledInstance is not really compiled, it's an instance of a compiled class value 2019-12-01 23:50:46 +01:00
Dave Halter f43d144e23 Remove is_package on contexts 2019-12-01 21:01:33 +01:00
Dave Halter 76e0e6a8c5 Fix some more package issues 2019-12-01 20:42:55 +01:00
Dave Halter 7b6405f76c Get rid of py__package__ from contexts 2019-12-01 19:33:24 +01:00
Dave Halter 8a26a23884 Make is_package a function and call it consistently 2019-12-01 19:31:31 +01:00
Dave Halter 6ffeea7eea Make sure code_lines works on stubs, even if they are builtins 2019-12-01 19:10:08 +01:00
Dave Halter 582df2f76d Fix the MixedContext and also use MixedModuleContext 2019-12-01 17:22:36 +01:00
Dave Halter 5c79472024 Separate CompiledModuleContext from CompiledContext, fixes #1428 2019-12-01 14:56:55 +01:00
Dave Halter 378712dbc1 Fix contextualizing of subscriptlist 2019-12-01 11:07:18 +01:00
Dave Halter b13c4c446f Fix a globals context issue, fixes #1435 2019-12-01 01:28:03 +01:00
Dave Halter e81c241905 Remove Python 2 implicit relative imports feature
Python 2 is almost gone, so I don't support those old features anymore.
2019-12-01 00:45:08 +01:00
Dave Halter c77f33b73b A small rename of a value that is actually a context 2019-12-01 00:31:22 +01:00
Dave Halter b895924311 Merge pull request #1451 from pappasam/FIX_SHOW_SYSTEM_FOLDERS
Fix: no longer shows folders recursively to root
2019-12-01 00:12:51 +01:00
Dave Halter 86071dda54 Use a different sys path for import completions and import type inference
Fix tests of the #1451 pull request
2019-12-01 00:12:19 +01:00
Dave Halter 59c5b51c0d Add __ne__ to BaseValueSet. Might have caused issues in Python 2, see #1442 2019-11-30 10:01:27 +01:00
Dave Halter 3c68d3d341 Avoid finding submodules for compiled objects, because it's at least not implemented 2019-11-29 17:18:04 +01:00
Dave Halter 8478ad7ffb Make sure that goto on a subscript colon doesn't crash 2019-11-29 17:10:07 +01:00
Dave Halter 98b592cb68 Fix getitem in compiled
This change just applies a change to CompiledObject that was done to values a long time ago
2019-11-29 16:14:17 +01:00
Dave Halter c38e4fce70 Make sure py__get__ is defined on all values
Also define matches_signature on all signatures, there's definitely cases where that might be called
2019-11-29 15:04:04 +01:00
Dave Halter 6e5e706288 Fix file name completions when file name is too long 2019-11-29 14:11:31 +01:00
Dave Halter 0e92be66db Fix an issue around completions in comments before strings 2019-11-29 13:44:12 +01:00
Dave Halter facd21afc6 Remove Python 3.9 dev build from travis, it's not needed 2019-11-27 20:50:29 +01:00
Dave Halter e1d840c89b Start to use Python 3.8 in the normal CI pipeline 2019-11-27 20:15:52 +01:00
Dave Halter 15c13c1386 Fix the pow test for Python 3.8 2019-11-27 20:12:50 +01:00
Dave Halter a6fcf779d4 Fix a small issue created in #1398 2019-09-21 23:29:07 +02:00
Dave Halter 66022edf14 Skip Python 2 tests for some array issues 2019-09-06 00:04:44 +02:00
Dave Halter ae79919eb4 Skip some param resolving tests in Python 2/3.4 2019-09-05 18:27:37 +02:00
Dave Halter fbe58306c3 Add a few tests for a previous assertion failure 2019-09-05 10:57:04 +02:00
Dave Halter 9c19f72af3 Make sure a compiled instance is is_compiled 2019-09-05 10:13:03 +02:00
Dave Halter a9f1d3d9bb Reenable a test 2019-09-05 10:09:33 +02:00
Dave Halter 1db3e9a65d Disable a test in Python2 2019-09-05 10:03:50 +02:00
Dave Halter 599eded3d1 Remove a few unused imports 2019-09-05 00:54:13 +02:00
Dave Halter 4e68287bba Move eval_node to one place 2019-09-05 00:52:14 +02:00
Dave Halter 008e9860a8 Avoid creating the same object twice 2019-09-05 00:37:51 +02:00
Dave Halter 8cd5932fed Move inference_state.goto to the name and _follow_error_node_imports_if_possible away from inference_state 2019-09-05 00:34:13 +02:00
Dave Halter 67c007338a Make some dynamic array variables private 2019-09-05 00:18:01 +02:00
Dave Halter aea2ddcbd8 ContextualizedName -> TreeNameDefinition 2019-09-05 00:15:38 +02:00
Dave Halter 4d332c32c0 Use create_name instead of duplicated logic 2019-09-05 00:04:24 +02:00
Dave Halter 02046d5333 Replace obj with value 2019-09-04 11:12:30 +02:00
Dave Halter 2faa8ade8b Remove get_object, it's not needed anymore 2019-09-04 11:04:09 +02:00
Dave Halter f9292ca8fa Implement properties properly 2019-09-04 11:00:43 +02:00
Dave Halter 40b01bfd2c Make arguments private for instance 2019-09-04 09:34:22 +02:00
Dave Halter 46e9b9e7cf Refactor dynamic params a bit 2019-09-04 09:31:01 +02:00
Dave Halter 96848dd627 Revert "Refactor some dynamic function arguments things"
This reverts commit e7d9a59da2.
2019-09-04 09:28:31 +02:00
Dave Halter e7d9a59da2 Refactor some dynamic function arguments things 2019-09-04 09:27:06 +02:00
Dave Halter dd400f115a Move some annotation inferring code to proper functions 2019-09-04 01:29:41 +02:00
Dave Halter 34f131e9b3 Remove an unneeded list cast 2019-09-04 01:22:16 +02:00
Dave Halter 47d6ae3da1 SimpleParamName -> AnonymousParamName 2019-09-04 01:20:44 +02:00
Dave Halter 79f9d78c83 Make create_instance_context a lot more understandable (and shorter) 2019-09-04 01:06:25 +02:00
Dave Halter 06d2119f51 Make sure a self variable is only defined in a function not outside 2019-09-04 00:53:46 +02:00
Dave Halter b27f47683c get_first_non_keyword_argument_values is not really used anymore 2019-09-04 00:08:49 +02:00
Dave Halter 0be9ab0caf A simplification 2019-09-04 00:03:03 +02:00