1
0
forked from VimPlug/jedi
Commit Graph

154 Commits

Author SHA1 Message Date
Dave Halter 30ef824abd Introduce some stricter typing 2026-02-04 01:19:14 +01:00
Eric Masseran 0f35a1b18b Split dataclass and dataclass_transform logic 2025-08-29 18:54:14 +02:00
Eric Masseran d53a8ef81c Support init customization on dataclass_transform source 2025-05-05 02:02:17 +02:00
Eric Masseran 5f4afa27e5 Documentation and better naming 2025-05-04 23:34:58 +02:00
Eric Masseran a3fd90d734 Fix dataclass decorator other parameters 2025-03-18 00:42:58 +01:00
Eric Masseran 999332ef77 Dataclass transform change init False 2025-03-18 00:30:50 +01:00
Eric Masseran e140523211 Fix attrs + remove dataclass_transform init=false tests 2025-03-17 23:51:53 +01:00
Eric Masseran bd1edfce78 Fix test 2025-03-17 19:48:42 +01:00
Eric Masseran 7dcb944b05 Fix decorator transformed case 2025-03-15 16:42:16 +01:00
Eric Masseran 50778c390f Fix init=false for transform and exclude fields on base transform 2025-03-15 16:23:32 +01:00
Eric Masseran 8912a35502 Support init=False for dataclass_transform 2025-03-15 16:00:51 +01:00
Eric Masseran 77cf382a1b Support init=False for dataclass 2025-03-15 15:53:51 +01:00
Eric Masseran 027e29ec50 Support base class and metaclass mode 2025-02-15 20:12:53 +01:00
Eric Masseran d866ec0f80 Add support for dataclass_transform decorator 2025-02-14 17:05:28 +01:00
Peter Law 483e78993d attrs' frozen decorator also acts like a dataclass
In 23.1.0 (specifically in https://github.com/python-attrs/attrs/commit/46053d703d99a6e7419fd291cbf546340690d69d)
the definition of the `frozen` decorator was tweaked slightly, such
that its type stub is separate from that for `define`. This means
that Jedi needs to be told about it as a separate member.

I've manually checked that this still works with the prior version
of `attrs`.

Fixes https://github.com/davidhalter/jedi/issues/1929
2023-05-27 00:13:55 +01:00
Alex Ford 40e1e3f560 Extend dataclass constructor hinting to attrs next-gen apis.
Trivially extends dataclass constructor hinting to attrs next-gen APIs.

This will stumble in cases where attrs extends beyond the standard
dataclasses API, such as complex use of defaults, converters, et al.
However, it likely covers the vast majority of cases which fall solidly
in the intersection of the two APIs.

Extension beyond these cases could use [PEP0681 dataclass_transforms],
however this is definitely a problem for another day.

[PEP0681 dataclass_transforms]: https://peps.python.org/pep-0681/

https://github.com/davidhalter/jedi/issues/1835
2022-10-11 17:40:31 -07:00
Dave Halter e671a0cb6d Fix an error with enums, fixes #1675 2020-10-23 20:25:00 +02:00
Mvdk ff439039da make contextualized_node an optional kwarg
In all other py__iter__ definitions that I found, this argument is optional. It also often seems to not be passed around. I'm not sure why it was deemed mandatory here despite not being used.
2020-09-14 10:27:19 -06:00
Dave Halter 784e965d3a @property now returns Name.type == 'property', fixes muffinmad/anakin-language-server#15 2020-07-20 01:20:24 +02:00
Dave Halter 1ece7698c2 Merge branch 'master' into python3 2020-07-17 16:07:54 +02:00
Dave Halter d1851c369c Introduce py__next__ to have more clear way to use __next__ 2020-07-17 15:57:32 +02:00
Dave Halter 24a1bbb3ca Even more super deletions 2020-07-02 12:29:10 +02:00
Dave Halter 5ab351dc8f Remove unicode literals from code base 2020-07-02 10:43:14 +02:00
Dave Halter 1fbe0d8d2e Remove python_version_match from publish_method 2020-07-02 03:04:14 +02:00
Dave Halter 6e184bca97 Remove most version_info.major usages 2020-07-02 03:00:01 +02:00
Dave Halter 49e4b1a0f8 Remove force_unicode 2020-07-02 01:47:21 +02:00
Dave Halter 395f7fc59e Remove inspect.Parameter compatibility 2020-07-02 00:44:25 +02:00
Dave Halter 9a54e583e7 Fix docstrings for method decorators, fixes #1621 2020-06-27 02:18:31 +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 364d33119c Merge branch 'django' 2020-06-14 22:24:31 +02:00
Dave Halter 674e0114a5 Ignore runtime_checkable, because we don't really need it 2020-06-14 14:14:47 +02:00
Dave Halter 6d0d75c7d9 @publish_method should provide arguments 2020-06-09 22:37:50 +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 34cc8e9ad7 Properly handle __get__ in properties/partials 2020-06-07 14:18:45 +02:00
Dave Halter 6dbc5e783e Fix argument clinic unpacking, remove dynamic bullshit 2020-05-10 13:27:20 +02:00
Dave Halter bdd4deedc1 Some code cleanups 2020-04-11 02:11:52 +02:00
Dave Halter 0888dd468f Fix partialmethod issues 2020-03-14 01:22:46 +01:00
Dave Halter 661fdb2b26 Merge branch 'add-partialmethod' of https://github.com/ffe4/jedi 2020-03-14 00:28:06 +01:00
Daniel Lemm 2406e58386 Refactor stdlib PartialObject
Merges PartialObject and PartialMethodObject. Also adds more tests.
Some parts are still WIP, see: #1522.

Fixes #1519
2020-03-13 23:47:48 +01:00
Daniel Lemm fd6540a9e5 Fix PartialMethodObject (WIP)
Implemented feedback from PR #1522.
Does not pass new tests in test/completion/stdlib.py
2020-03-13 21:40:58 +01:00
Daniel Lemm 96c969687a Add partialmethod, fixes #1519
Returns correct method signature but test/completion/stdlib.py fails
2020-03-12 18:47:17 +01:00
Dave Halter d574162da3 Fix namedtuple docstring/signature issues, fixes #1506 2020-03-10 20:07:10 +01:00
Dave Halter 47e2cf95d2 Change ModuleValue param order and add defaults 2020-01-01 17:07:19 +01:00
Dave Halter 3ec73f1da3 Fix namedtuple issues that were uncovered by the 'self' changes 2019-12-27 23:57:22 +01:00
Dave Halter ed3fdf8876 Make sure classmethod signatures don't include cls, fixes #1455 2019-12-09 08:58:59 +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 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 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