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
6d0d75c7d9
@publish_method should provide arguments
2020-06-09 22:37:50 +02:00
Dave Halter
d4f0424ddc
Move py__getitem__ from Class to ClassMixin
2020-06-08 00:58:38 +02:00
Dave Halter
cd6113c2c3
Move with_generics and define_generics to ClassMixin
2020-06-08 00:11:45 +02:00
Dave Halter
c9a21adc5f
Make sure py__get__ is applied properly for Django metaclasses
2020-06-07 15:01:12 +02:00
Dave Halter
9adcf3d233
Make sure meta class filters can distinguish between classes and instances
2020-06-07 14:54:26 +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
Dave Halter
21a380f7cb
Merge pull request #1590 from muffinmad/references-scope
...
Get references in the current module only
2020-06-05 19:21:34 +02:00
muffinmad
782dedd439
Get references in the current module only
2020-06-03 16:35:28 +03:00
muffinmad
1c342d36e5
Don't goto while building found_names for the current file
...
But goto for all non_matching_reference_maps items later
2020-05-24 22:58:04 +03:00
Peter Law
c62cbd6654
Explicitly handle a not in b operator comparison
...
This avoids a `KeyError` from operator_to_magic_method lookup for
this case. Jedi probably could check for `__contains__` here, however
as it doesn't do so for `in` checks I'm following that lead for now.
Fixes https://github.com/davidhalter/jedi/issues/1594 .
2020-05-23 12:49:53 +01:00
muffinmad
741097827d
Get references in the current module only
2020-05-21 19:51:13 +03:00
Christopher Cave-Ayland
860d5e8889
Import FileNotFoundError from jedi._compatibility
2020-05-21 11:45:52 +02:00
Dave Halter
cd3d40a3b8
Fix a small issue
2020-05-16 15:42:15 +02:00
Dave Halter
b3fc10a6e4
Magic methods fixes for reverse methods
2020-05-16 15:39:48 +02:00
Dave Halter
09dbbc6361
lists and tuples should not be added
2020-05-16 15:10:47 +02:00
Dave Halter
f5ad561c51
Use __truediv__ instead of __div__
...
This ignores Python 2, but that shouldn't be an issue, since we are going to drop it anyway.
2020-05-16 14:57:57 +02:00
Dave Halter
0db50b521d
Fix an issue with Tuple generics
2020-05-16 14:55:59 +02:00
Dave Halter
9942a3d44c
A few class renames
2020-05-16 14:35:15 +02:00
Dave Halter
47637c147c
Better debugging
2020-05-16 14:31:31 +02:00
Dave Halter
70aa7fc917
Fix a namespace issue when getting references
2020-05-16 01:05:39 +02:00
Dave Halter
41c146a6f3
Implement magic method return values, fixes #1577
2020-05-15 23:53:44 +02:00
Dave Halter
be594f1498
Remove an unused cache method
2020-05-15 23:53:44 +02:00
Dave Halter
99eba4e0eb
Undefined api types should not return a random value
2020-05-15 23:53:44 +02:00
Peter Law
43806f8668
Add support for generic optional parameters ( #1559 )
...
* Add support for generic optional parameters
* Tests for passing non-optional arguments to optional parameters
* Remove now-redundant is_class_value handling
This parameter has since been removed from infer_type_vars methods,
much simplifying the code.
2020-05-15 19:56:03 +02:00
Dave Halter
3104443212
Merge pull request #1579 from muffinmad/pseudotreenameclass
...
Return 'class' as _PseudoTreeNameClass.type (fix #1578 )
2020-05-13 18:59:05 +02:00
Dave Halter
0caee73975
Merge pull request #1572 from davidhalter/classvar
...
Remove is_class_value from infer_type_vars
2020-05-12 23:56:03 +02:00
muffinmad
7cd89cff6e
Return 'class' as BaseName.type of _PseudoTreeNameClass ( fix #1578 )
2020-05-12 23:14:32 +03:00
Vlad Serebrennikov
e1c0d2c501
Reduce noise in signatures of compiled params ( #1564 )
...
* Remove "typing." prefix from compiled signature param
* Don't print default "None" for Optional params
* Don't remove 'typing.' prefix if symbol doesn't come from typing module
* Revert "Don't print default "None" for Optional params"
This reverts commit 8db334d9bb .
* Make sure "typing." doesn't appear in the middle
* Make sure only "typing." prefix is removed and not it's entries in the middle
* Use inspect.formatannotation() to create an annotation string
* Update AUTHORS.txt
* Add test for compiled param annotation string
* Replace Optional in test with other typing facilities
in order for test to be forward-compatible with 3.9
* Add an empty string fallback for Python 2
* Move _annotation_to_str back to original position
2020-05-10 13:33:36 +02:00
Dave Halter
6dbc5e783e
Fix argument clinic unpacking, remove dynamic bullshit
2020-05-10 13:27:20 +02:00
Dave Halter
e6e43413ff
Any -> AnyClass
2020-05-10 03:17:52 +02:00
Dave Halter
e9a0c01af8
TypedDictBase -> TypedDictClass
2020-05-10 03:17:07 +02:00
Dave Halter
d0270b5e59
DefineGenericBase -> DefineGenericBaseClass
2020-05-10 03:07:40 +02:00
Dave Halter
b57654aed3
Rename some classes to make it clearer that they are classes
2020-05-10 03:04:52 +02:00
Dave Halter
78ad06612e
Remove an unused import
2020-05-10 03:00:47 +02:00
Dave Halter
434866558a
Instances should not need get_generics
2020-05-10 02:59:54 +02:00
Dave Halter
42963a0e03
By having get_annotated_class_object for Tuple/Callable, some details are not necessary anymore
2020-05-10 02:52:42 +02:00
Dave Halter
c2d1da09cb
Make sure that Tuple/Callable instances have the correct py__class__
2020-05-10 01:05:55 +02:00
Dave Halter
f362932ec5
Return a more correct py__class__ for typing base objects
2020-05-09 16:28:05 +02:00
Dave Halter
3b48c76e4a
Make a function private
2020-05-09 00:49:37 +02:00
Dave Halter
d56f607f35
Reinstate an if that was deleted by mistake
2020-05-09 00:13:18 +02:00
Dave Halter
39a2cd8aa2
Fix a potential issue with tuples
2020-05-08 18:07:15 +02:00
Dave Halter
14ca8e6499
Add a comment
2020-05-08 18:00:35 +02:00
Dave Halter
2a227dcc7a
Remove is_class_value from infer_type_vars
2020-05-08 17:49:02 +02:00
Dave Halter
12090ce74b
Fix tests
2020-05-08 15:18:23 +02:00
Dave Halter
25973554e2
Remove the common folder and move it to a common file
2020-05-08 13:23:56 +02:00
Dave Halter
138c22afe9
Remove common.value
2020-05-08 13:18:01 +02:00
Dave Halter
d19535340c
Move infer_type_vars to base_value
2020-05-08 13:13:26 +02:00
Dave Halter
5fcbed721d
Merge pull request #1554 from PeterJCLaw/fix-nested-tuple-argument
...
Fix handling of nested tuple arguments
2020-05-08 12:49:44 +02:00
Sam Roeca
812776b9ce
Add .venv to _IGNORE_FOLDERS
...
".venv" is a popular virtual environment folder name; project.search
gets really mucked up when it isn't ignored.
2020-05-05 21:15:18 +02:00