1
0
forked from VimPlug/jedi
Commit Graph

791 Commits

Author SHA1 Message Date
Dave Halter a1d9da0a7f Make sure tuple behaves similar to Tuple, fixes #2040 2026-04-30 00:15:56 +02:00
Dave Halter 4f7dfd14b3 Small improvements to generator/async completions 2026-04-29 23:38:07 +02:00
Dave Halter be993d132e Attempt to improve tuple unpackings 2026-04-29 23:10:31 +02:00
Dave Halter 0d79865a0f Fix __enter__ Self resolving 2026-04-29 18:15:57 +02:00
Dave Halter 3375d48f8c Improve typing_extensions usages 2026-04-29 18:08:59 +02:00
Dave Halter aa72381ed1 Implement Self, fixes #2023, fixes #2068 2026-04-29 17:51:01 +02:00
Dave Halter 75f1d064d5 Ignore Final/ClassVar if they don't have a generic assignment 2026-04-28 17:05:43 +02:00
Dave Halter 6473ddc28c Implement Final[...] in a way so it doesn't completely fail 2026-04-28 15:49:26 +02:00
Dave Halter 3365d0763b Implement __new__ signatures, fixes #2073 2026-04-28 02:25:25 +02:00
Dave Halter ff581e8403 Start fixing some of the problems with new typeshed 2026-04-28 01:41:40 +02:00
Dave Halter 6e17c85a57 Avoid flake8 issues 2026-04-27 15:29:08 +02:00
Dave Halter 44600ea194 Fix union acess for 3.14 2026-04-27 15:21:26 +02:00
Dave Halter d4233732be Format unions with | consistently 2026-04-27 14:24:23 +02:00
Dave Halter 94f7e540ff Merge branch 'py314' of https://github.com/frenzymadness/jedi into py314 2026-04-27 12:22:31 +02:00
Dave Halter 1eddf24a50 Remove Python 3.9 and 3.10 2026-04-27 00:34:17 +02:00
Dave Halter edb5462cf5 Fix an issue with tests 2026-04-26 03:05:30 +02:00
Lumir Balhar 04737b2637 Fix Python 3.15 compatibility
- Fix getattr_static for Python 3.15 __dict__ GetSetDescriptorType
- Accept abs() parameter name change ('x' → 'number')
- Add Python 3.15 os module constants to test expectations

Fixes instance attribute introspection and stdlib changes in Python 3.15.
2026-04-08 08:19:15 +02:00
Dave Halter 68be64b992 Use forward references because 3.8 is still a bit annoying 2026-03-26 23:31:24 +01:00
Lumir Balhar 9b24443787 Fix Python 3.14 compatibility for typing.Union annotations
In Python 3.14, typing.Union changed its repr from 'typing.Union[X, Y]'
to 'X | Y' (PEP 604), breaking annotation inference.

Changes:
- Use getattr() instead of safe_getattr() for __module__ retrieval
  (getattr_static fails on Union types in Python 3.14)
- Add fallback to typing.get_origin() when regex fails to match
- Normalize Union display back to 'Union[X, Y]' format for consistency
- Update test expectations for invalid annotation edge case in 3.14

Fixes: https://github.com/davidhalter/jedi/issues/2064
2026-03-09 15:39:23 +01:00
Dave Halter e7fdbcc834 Fix a few more typing issues 2026-02-04 02:24:41 +01:00
Dave Halter 3ffed76884 Improve a weird typing issue 2026-02-04 01:28:30 +01:00
Dave Halter 30ef824abd Introduce some stricter typing 2026-02-04 01:19:14 +01:00
Dave Halter c7481b3319 Fix a linter issue 2026-01-20 02:05:51 +01:00
Dave Halter 3ac1632a5c Avoid the need to import search_ancestor 2026-01-19 20:30:03 +01:00
Mark Diekhans a89757a966 Handle object with __file__ attribute having a None value (issue #2082) 2025-12-20 17:24:25 -08:00
Hoblovski 3454ebb1de fix: let star_expr infer to NO_VALUES instead of crashing 2025-11-13 20:41:58 +08:00
Eric Masseran 15a7513fd0 Improve code comment 2025-08-29 18:54:30 +02:00
Eric Masseran 3a436df7ac Remove property usage 2025-08-29 18:37:37 +02:00
Eric Masseran c1e9aee15b Clean code comments 2025-08-29 18:37:23 +02:00
Eric Masseran 6e5f201f6c Use future annotations 2025-08-29 18:36:54 +02:00
Eric Masseran 356923e40d Merge remote-tracking branch 'origin' into support-dataclass-transform
* origin:
  Fix pip install -e in docs
  Upgrade Mypy
  Fix a few flake8 issues
  Upgrade flake8
  Upgrade other test runners
  Remove 3.6/3.7 references and change tests slightly
  Upgrade OS's that it is tested on
  Try to add something to the README
2025-08-28 10:33:17 +02:00
Dave Halter d411290dff Upgrade Mypy 2025-06-16 16:49:46 +02:00
Dave Halter e5a72695a8 Remove 3.6/3.7 references and change tests slightly 2025-06-16 16:18:15 +02:00
Eric Masseran 503c88d987 Merge remote-tracking branch 'origin' into support-dataclass-transform
* origin:
  Don't remove `sys.path[0]`.
  perf: improve performance by replacing list to set
  Explicit sphinx config path
2025-05-05 02:03:07 +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 999332ef77 Dataclass transform change init False 2025-03-18 00:30:50 +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 472ee75e3c Add ClassVar support for dataclass 2025-03-15 13:15:19 +01:00
Eric Masseran efc7248175 Fix mypy 2025-03-15 12:05:05 +01:00
Damian Birchler 35a12fab7a Don't remove sys.path[0].
Fixes https://github.com/davidhalter/jedi/issues/2053.
2025-03-13 09:52:49 +01:00
Robin 699c930bd4 perf: improve performance by replacing list to set 2025-03-05 12:53:08 +00:00
Eric Masseran 74b46f3ee3 Add doc 2025-02-15 20:27:08 +01:00
Eric Masseran 027e29ec50 Support base class and metaclass mode 2025-02-15 20:12:53 +01:00
WutingjiaX 2859e4f409 Support inferring not expr to bool (#2016)
* support inferring some not expr

* format

---------

Co-authored-by: wutingjia <wutingjia@bytedance.com>
2024-07-12 12:58:39 +00:00
wutingjia 4d09ac07e4 When inferring comparison operators, return a definite type instead of NO_VALUES for the in/not in operator 2024-07-10 11:20:11 +08:00
Peter Law d543d1d004 Support Python 3.13
This moves to using the 3.13 grammar as well as testing 3.13 in CI.
2024-07-02 21:37:34 +01:00
Peter Law a67deeb602 Fix race condition around subprocess inference state tidyup
There was a race condition due to the combination of Python's
object ids being re-usable and Jedi persisting such ids beyond
the real lifeteime of some objects. This could lead to the
subprocess' view of the lifetime of `InferenceState` contexts
getting out of step with that in the parent process and
resulting in errors when removing them. It is also possible
that this could result in erroneous results being reported,
however this was not directly observed.

The race was specifically:
- `InferenceState` A created, gets id 1
- `InferenceStateSubprocess` A' created, uses `InferenceState`
  A which it stores as a weakref and an id
- `InferenceStateSubprocess` A' is used, the sub-process learns
  about an `InferenceState` with id 1
- `InferenceState` A goes away, `InferenceStateSubprocess` A' is
  not yet garbage collected
- `InferenceState` B created, gets id 1
- `InferenceStateSubprocess` B' created, uses `InferenceState` B
  which it stores as a weakref and an id
- `InferenceStateSubprocess` B' is used, the sub-process re-uses
  its entry for an `InferenceState` with id 1

At this point the order of operations between the two
`InferenceStateSubprocess` instances going away is immaterial --
both will trigger a removal of a state with id 1. As long as B'
doesn't try to use the sub-process again after the first removal
has happened then the second removal will fail.

This commit resolves the race condition by coupling the context
in the subprocess to the corresponding manager class instance
in the parent process, rather than to the consumer `InferenceState`.

See inline comments for further details.
2024-07-02 21:37:34 +01:00