Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Implement pyright support via dataclass_transforms#796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
hynek merged 19 commits intopython-attrs:mainfromasford:dataclass_transforms
May 5, 2021
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
19 commits
Select commitHold shift + click to select a range
52d769c
Add __dataclass_transform__ decorator.
asfordApr 27, 2021
1891373
Add doc notes for pyright dataclass_transform support.
asfordApr 27, 2021
4f3787c
Fix docs build error.
asfordApr 28, 2021
bba9d7a
Expand docs on dataclass_transform
asfordApr 29, 2021
70e4286
Add changelog
asfordApr 29, 2021
41b4149
Fix docs build
asfordApr 29, 2021
8abde8a
Fix lint
asfordApr 29, 2021
2a4f8df
Add note on __dataclass_transform__ in .pyi
asfordApr 29, 2021
822722b
Add baseline test of pyright support via tox
asfordApr 29, 2021
55a0675
Add pyright tests to tox run configuration
asfordApr 29, 2021
7c21153
Fix test errors, enable in tox.
asfordApr 29, 2021
e8a4c0d
Fixup lint
asfordApr 29, 2021
6d10e30
Move pyright to py39
asfordApr 30, 2021
5fa3b2d
Add test docstring.
asfordApr 30, 2021
59714cf
Fixup docs.
asfordApr 30, 2021
68e86bf
Merge branch 'main' into dataclass_transforms
hynekMay 1, 2021
693e71b
Merge branch 'main' into dataclass_transforms
hynekMay 3, 2021
e63087b
Merge branch 'main' into dataclass_transforms
hynekMay 5, 2021
7876c40
Merge branch 'main' into dataclass_transforms
hynekMay 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Fix lint
  • Loading branch information
@asford
asford committedApr 29, 2021
commit8abde8af3c816d3cf317ede1e0a93bf71f47778c
5 changes: 2 additions & 3 deletionschangelog.d/796.change.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
`attrs` has added provisional support for static typing in `pyright` version 1.1.135 via the `dataclass_transforms specification <https://github.com/microsoft/pyright/blob/1.1.135/specs/dataclass_transforms.md>`.

Both the `pyright` specification and ``attrs`` implementation may changed in future versions.
``attrs`` has added provisional support for static typing in ``pyright`` version 1.1.135 via the `dataclass_transforms specification <https://github.com/microsoft/pyright/blob/1.1.135/specs/dataclass_transforms.md>`.
Both the ``pyright`` specification and ``attrs`` implementation may change in future versions of both projects.

Your constructive feedback is welcome in both `attrs#795 <https://github.com/python-attrs/attrs/issues/795>`_ and `pyright#1782 <https://github.com/microsoft/pyright/discussions/1782>`_.
4 changes: 2 additions & 2 deletionsdocs/extending.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -94,12 +94,12 @@ Pyright

Generic decorator wrapping is supported in pyright via the provisional `dataclass_transform <https://github.com/microsoft/pyright/blob/1.1.135/specs/dataclass_transforms.md>`_ specification.
For a custom wrapping of the form::

def custom_define(f):
return attr.define(f)

This is implemented via a `__dataclass_transform__ <https://github.com/microsoft/pyright/blob/master/specs/dataclass_transforms.md#applying-to-attrs>`_ type decorator in .pyi via::

@__dataclass_transform__(field_descriptors=(attr.attrib, attr.field))
def custom_define(f): ...

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp