Commit Graph

13 Commits

Author SHA1 Message Date
Irina.Fediaeva
181edc5caa PY-50788: Correct resolve for inherited docstring attribute names
Now during resolve if there is no class/instance attribute with appropriate name explicitly in the class, we will try to find it in the parent classes and resolve there.

GitOrigin-RevId: 52ab5f0ad63cba187457ba3db6107997ede33dee
2022-10-03 13:21:34 +00:00
Tagir Valeev
adb060863f Text blocks used
GitOrigin-RevId: 7db538c0a10131a3f946436c85b42fe7d7dc5b10
2022-09-29 12:58:29 +00:00
Irina.Fediaeva
cce0ef17d5 PY-16760, PY-28549, PY-35743, PY-55609, PY-46654: Correct resolve of class attributes in docstrings
Previously in docstrings we incorrectly recognized references in 'Attributes' section only as instance attribute references. It led to false positive 'Unresolved reference' on class attributes references in docstrings and wrong resolve when using class and instance attributes with the same names. Now we use ReferenceType.VARIABLE to identify both class and instance attribute references in 'Attributes' section and then resolve them with priority of instance attributes. Also fixed wrong resolve of attributes references to constructor parameters.

GitOrigin-RevId: ea10bfb092472c0ab14b77f06efd93093cfcd684
2022-08-25 21:11:57 +00:00
Semyon Proshev
7b8b5bb12f Make creating resolve context with explicit type eval context shorter
GitOrigin-RevId: 7dce0f1869ca114d729f8368273291940eda21ef
2021-06-13 14:50:11 +00:00
Irina Fediaeva
48e8e52668 PY-36062: Add resolve attributes matching PyModuleType.MODULE_MEMBERS to types.ModuleType attributes. Add matching PyClassType: ModuleType to PyModuleType.
GitOrigin-RevId: d2988397e4a58f9170a90cd6a3251054dedf896f
2020-12-16 13:31:50 +00:00
Semyon Proshev
fbbb78bc4e Change receiver for initialization calls and don't resolve callee to constructors
Callee is now a receiver for these cases, previously it was `null`.
Callee is not replaced with constructors to have an ability to map it onto self/cls parameters and process `(cls: Type[T], ...) -> T` annotations.
Stay with the previous behaviour for navigation and looking for target element.

GitOrigin-RevId: c0f9894cf50fd5d7fd325f095976d096fb948e89
2020-11-11 19:30:34 +00:00
andrey.matveev
3055c4293a PY-41676 Fix hasattr resolve issue str object is not callable
GitOrigin-RevId: aa9583ab678dd48a9264209b9bb2545b435e9d26
2020-05-22 11:46:28 +03:00
Semyon Proshev
40c9d375e5 Don't consider metaclass.__call__(cls, *args, **kwargs) as a possible constructor (PY-17877, PY-41380)
GitOrigin-RevId: de83bde719d08de70dcff7f3ad7dfa722a66af72
2020-04-28 21:08:25 +00:00
Ilya.Kazakevich
18c1e98d54 Logging deprecated method usage
GitOrigin-RevId: f477b9aa83e5337399a5b798a21cd0d5c1490d7c
2020-04-26 22:37:36 +00:00
Semyon Proshev
e554ef0533 Consider metaclass __call__ as one more possible constructor (PY-17877)
GitOrigin-RevId: 2b2a6e8ddf5bde58c628057dc609e63c135430c3
2020-02-04 12:04:59 +00:00
andrey.matveev
d66e0eec0e PY-10184 Impl hasattr support
GitOrigin-RevId: e5826372ddfe233656097da774d978c57ee54937
2019-12-23 13:08:30 +00:00
Stanislav Utikeev
c2caaf5e07 Better asserts for instanceof in PyCommonResolveTest
GitOrigin-RevId: d069f37da3983476da49cc4813d8237996dabf4b
2019-12-03 15:11:09 +00:00
Stanislav Utikeev
64a66563fb Consistent naming for common Python tests and fixtures: (Python|Py)(Common|Platform?|Psi)(.+)
GitOrigin-RevId: 648dc76cfd3edc5567f46eceaeaaa9afa5433331
2019-12-03 15:11:09 +00:00