Commit Graph

7833 Commits

Author SHA1 Message Date
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
2fb072532a Skip another non-important Python 2 test that fails on Windows 2020-05-16 01:25:15 +02:00
Dave Halter
70aa7fc917 Fix a namespace issue when getting references 2020-05-16 01:05:39 +02:00
Dave Halter
384b2ad014 Fix an about dict completions 2020-05-16 00:46:46 +02:00
Dave Halter
f2975f9a05 Fix a None issue 2020-05-16 00:27:14 +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
d4aa583e16 Fix inline case where a name was removed without the code being used, fixes #1582 2020-05-14 23:08:37 +02:00
Dave Halter
381fbeda6a Make the diff nicer if there is no ending newline, fixes #1581 2020-05-14 00:20:20 +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
muffinmad
16e2b86bcf Fix test 2020-05-13 01:18:47 +03: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
Dave Halter
7f25e28d89 Fix tuple issue in 3.6 2020-05-12 23:33:06 +02:00
muffinmad
ce8473ee63 Add author's name to AUTHORS.txt 2020-05-12 23:34:28 +03:00
muffinmad
7ccee7d8fc Add test _PseudoTreeNameClass.type == 'class' 2020-05-12 23:28:46 +03: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
be7a1346ec Fix #1573 again; a tree_node can be None 2020-05-10 13:29:58 +02:00
Dave Halter
6dbc5e783e Fix argument clinic unpacking, remove dynamic bullshit 2020-05-10 13:27:20 +02:00
Max Mäusezahl
1115cbd94d This fixes two issues with the caching on Windows:
* the cache directory should really be %LOCALAPPDATA%
 * ~ is not a meaningful directory on Windows. It should really be
   os.path.expanduser('~'). To be honest it is probably always safe to
   assume that os.getenv('LOCALAPPDATA') executes to something sensible
   on any Windows system that hasn't been tampered with.
2020-05-10 11:46:29 +02:00
Dave Halter
bf4ec2282f Fix getattr completions on very weird cases, fixes #1573 2020-05-10 11:37:58 +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
Dave Halter
d606ea6759 Correct a test 2020-04-27 09:59:38 +02:00
Dave Halter
c314e1c36e Speed up signature fetching for MixedName, see discussion in #1422 2020-04-27 01:53:42 +02:00
Dave Halter
8c7a883abd Test that the actual signature of a function is used in Interpreter 2020-04-27 01:47:06 +02:00
Peter Law
55facaaf3d Switch back to using execute_annotation
get_annotated_class_object is (sort-of) the inverse of execute_annotation,
so adding a get_annotated_class_object to implement execute_annotation
specifically for Tuples didn't make much sense.
2020-04-26 14:39:39 +01:00