From 483e78993df794b39ee4433310103c5fcc4c8e96 Mon Sep 17 00:00:00 2001 From: Peter Law Date: Sat, 27 May 2023 00:11:47 +0100 Subject: [PATCH] `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 --- jedi/plugins/stdlib.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jedi/plugins/stdlib.py b/jedi/plugins/stdlib.py index 81803090..e1004ec8 100644 --- a/jedi/plugins/stdlib.py +++ b/jedi/plugins/stdlib.py @@ -808,9 +808,11 @@ _implemented = { # https://www.attrs.org/en/stable/names.html 'attr': { 'define': _dataclass, + 'frozen': _dataclass, }, 'attrs': { 'define': _dataclass, + 'frozen': _dataclass, }, 'os.path': { 'dirname': _create_string_input_function(os.path.dirname),