summaryrefslogtreecommitdiff
path: root/astroid/brain/brain_dataclasses.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix the signature of ``infer_call_result``Daniel van Noord2023-04-251-1/+3
|
* Drop support for Python 3.7 (#2137)Marc Mueller2023-04-231-7/+1
|
* Fix constructor in dataclass brainDaniël van Noord2023-04-231-0/+2
|
* Fix constructors of ``Call``Daniël van Noord2023-04-041-1/+1
|
* [PyCQA migration] Upgrade links to the repositories in code and docPierre Sassoulas2023-03-291-2/+2
|
* Upgrade pre-commit configuration and move to ruff (#2057)Pierre Sassoulas2023-03-141-1/+1
|
* Create ``UninferableBase``Daniël van Noord2023-02-051-3/+3
|
* Fix order of overwritten attributes in inherited dataclasses (#1970)Daniël van Noord2023-01-171-24/+49
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Initial pass with ``pydocstringformatter``Daniël van Noord2023-01-091-5/+7
|
* Handle kw_only=True in dataclass fieldsDaniël van Noord2022-12-271-14/+25
|
* Handle init=False with defaults in dataclasses (#1898)Daniël van Noord2022-12-271-19/+45
|
* Handle properties in dataclasses correctlyDaniël van Noord2022-12-071-0/+19
|
* Fix regression in the creation of the ``__init__`` of dataclasses (#1812)Daniël van Noord2022-10-041-27/+42
| | | Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
* Fixed the ``__init__`` of ``dataclassess`` with multiple inheritance (#1774)Daniël van Noord2022-09-071-20/+42
|
* Fix crash in ``dataclass`` brain (#1770)Daniël van Noord2022-09-061-66/+66
|
* Parse default values in ``dataclass`` attributes correctly (#1771)Daniël van Noord2022-09-061-4/+1
|
* Fix crash in ``dataclass`` brain (#1768)Daniël van Noord2022-09-061-1/+3
|
* Handle ``dataclass`` ``kw_only`` keyword correctly (#1764)Daniël van Noord2022-09-051-34/+67
| | | Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
* Don't add ``KW_ONLY`` fields to dataclass fields (#1746)Daniël van Noord2022-08-221-2/+16
|
* Update typing for Python 3.7 (2) (#1556)Marc Mueller2022-05-131-1/+2
|
* Update typing for Python 3.7 (1) (#1555)Marc Mueller2022-05-131-6/+9
|
* Require Python 3.7.2 (#1542)Jacob Walls2022-05-101-15/+14
|
* Simplify hard to maintain copyright notice (#1441)Pierre Sassoulas2022-03-121-0/+2
| | | | | | | | | | | | | | * Simplify hard to maintain copyright notice git is the source of truth for the copyright, copyrite (the tool) was taking exponentially longer with each release, and it's polluting the code with sometime as much as 50 lines of names. * Add a pre-commit hook to check the copyright notice * Fix the existing file so they have a notice * Fix the spacing after the copyright notice * Add a script to generate the CONTRIBUTORS.txt Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
* Add is_dataclass attribute to ClassDef (#1391)Daniël van Noord2022-02-131-0/+1
|
* Add typing to ``brain_dataclasses`` (#1292)Daniël van Noord2021-12-291-28/+44
| | | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com> Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Fix dataclass inference for marshmallow_dataclass (#1298)Nicolas Noirbent2021-12-231-2/+7
|
* Add ``future`` argument to all ``NodeNG.statement()`` calls (#1235)Daniël van Noord2021-11-241-1/+1
| | | | | | | * Add ``future`` argument to all ``NodeNG.statement()`` calls * Add typing from ``statement()`` Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Refactor and remove ``redefined-variable-type`` disableDaniël van Noord2021-10-241-4/+4
|
* Fix crash with invalid field call (#1212)Marc Mueller2021-10-151-0/+1
|
* Support dataclass inference for pydantic.dataclasses.David Liu2021-09-171-7/+6
|
* Fix all R6201: Consider using set for membershipPierre Sassoulas2021-09-171-2/+2
| | | | Following the upgrade to pylint 2.11.1
* Fix crash on datafields (#1165)Daniël van Noord2021-09-131-2/+10
| | | | | | | | | | | | | | | * Fix crash on datafields Fixes the crash reported at PyCQA/pylint#4963 Tests added there. * Change to ``if not`` * Update astroid/brain/brain_dataclasses.py * Add tests * Update and merge test * Use ``raise UseInferenceDefault``
* Relax dataclass filter for Uninferable nodes. (#1144)David Liu2021-08-271-33/+40
| | | | | | | Now, any Uninferable node that looks like "dataclass" or "<expr>.dataclass" will be treated as a dataclass decorator. This supports pydantic.dataclasses.dataclass, as this value is currently Uninferable.
* Add filter for abc.collections in dataclass inferenceDavid Liu2021-08-221-0/+1
|
* Generate synthetic __init__ method for dataclassesDavid Liu2021-08-201-25/+176
|
* Restrict type inference of dataclass attributes. (#1130)David Liu2021-08-161-10/+39
| | | | | | | | | | For now, from the typing module only generic collection types are inferred: Dict, FrozenSet, List, Set, Tuple. Astroid proxies these to the built-in collection types (e.g., dict). Other type annotations from typing like Callable and Union yield Uninferable; these would need to be handled on a case by case basis. Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Add inference tips for dataclass attributes (#1126)David Liu2021-08-161-33/+211
| | | | | * Add inference tips for dataclass attributes Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Remove use of deprecated node_classes and scoped_node API in astroidPierre Sassoulas2021-08-101-2/+2
|
* Fix copyright links (#1084)Marc Mueller2021-07-011-1/+1
| | | | * Fix link in license header * Fix link to cpython
* Simplification because AstroidManager is a singleton/borgPierre Sassoulas2021-06-191-2/+4
|
* Create a file for the global manager defined in astroid.__init__.pyPierre Sassoulas2021-06-191-1/+1
|
* Import directly from modules in astroid.brain.*Pierre Sassoulas2021-06-191-12/+18
|
* Add an isort configuration in setup.cfg and apply itPierre Sassoulas2021-04-191-1/+0
| | | | Except on astroid/__init__.py because of circular imports
* Fix issue #891Pierre Sassoulas2021-04-101-1/+1
| | | | Remove outdated COPYING and rename COPYING.LESSER
* Don't transform dataclass ClassVars (#914)Marc Mueller2021-02-281-0/+12
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* A transform for the builtin `dataclasses` module was added.Claudiu Popa2019-09-261-0/+50
This should address various `dataclasses` issues that were surfaced even more after the release of pylint 2.4.0. In the previous versions of `astroid`, annotated assign nodes were allowed to be retrieved via `getattr()` but that no longer happens with the latest `astroid` release, as those attribute are not actual attributes, but rather virtual ones, thus an operation such as `getattr()` does not make sense for them.